Skip to content

system.has: Query system capabilities #82

@pyroscope

Description

@pyroscope

Docs: https://rtorrent-docs.readthedocs.io/en/latest/cmd-ref.html#term-system-has

This can be used to write configs that work on older builds (and on vanilla), when new features / commands are introduced. Especially in combination with a branched import, so whole snippets using new features are safe and don't blow up in older builds.

To make sure the system.has command can be actually used, add this somewhere early in the config:

# `system.has` polyfill (the "false=" silences the `catch` command, in rTorrent-PS)
catch = {"false=", "method.redirect=system.has,false"}

The following branch somehow self-absorbed shows how this can be used:

branch=(system.has, system.has), ((print, "Your build can haz system.has!"))

In a vanilla rTorrent, there is silence, and zero capabilities.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions