Skip to content

Commit

Permalink
system.has: confitional import= example
Browse files Browse the repository at this point in the history
  • Loading branch information
pyroscope committed May 31, 2018
1 parent d1eedd4 commit d2dfc97
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/include-cmd-system.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,6 @@ Commands related to the operating system and the XMLRPC API.
This can be used to write configuration files that work on older builds
(and on vanilla rTorrent), even when new features and commands are introduced.
It's especially useful in combination with a branched import, so whole snippets
using new features are safe and don't blow up in older builds.

If a method name (ending in ``=``) is passed, the call returns ``true``
when that method is already defined.
Expand Down Expand Up @@ -288,6 +286,15 @@ Commands related to the operating system and the XMLRPC API.
# Set "pyro.extended" to 1 to activate rTorrent-PS features!
method.insert = pyro.extended, const|value, (system.has, rtorrent-ps)
It's also especially useful in combination with a branched import, so whole snippets
using new features are safe and don't blow up in older builds.
Or conditionally backfill something missing in older builds, like in this example:

.. code-block:: ini
# Define default columns for older rTorrent-PS builds
branch=(not, (system.has, canvas_v2)), ((import, rtorrent.d/05-rt-ps-columns.rc.include))
system.hostname

.. code-block:: ini
Expand Down

0 comments on commit d2dfc97

Please sign in to comment.