Skip to content

Commit 9af6233

Browse files
committed
docs: use 'option' directive and Sphinx roles
1 parent c1872a2 commit 9af6233

File tree

1 file changed

+58
-24
lines changed

1 file changed

+58
-24
lines changed

docs/usage-cli-tools.rst

Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,58 @@
33
Overview of CLI Tools
44
^^^^^^^^^^^^^^^^^^^^^
55

6-
``rtcontrol`` is the work-horse for rTorrent automation, it takes filter conditions
6+
:command:`rtcontrol` is the work-horse for rTorrent automation, it takes filter conditions
77
of the form ``‹field›=‹value›`` and selects a set of download items according to them.
88
That result can then be printed to the console according to a specified format,
99
or put into any rTorrent view for further inspection.
1010
You can also take some bulk action on the selected items, e.g. starting, stopping, or deleting them.
1111

12-
``rtxmlrpc`` sends single XMLRPC commands to rTorrent, and ``rtmv`` allows you to move around the
12+
:command:`rtxmlrpc` sends single XMLRPC commands to rTorrent, and :command:`rtmv` allows you to move around the
1313
data of download items in the file system, while continuing to seed that data.
1414

1515
The following commands help you with managing metafiles:
1616

17-
* ``lstor`` safely lists their contents in various formats.
18-
* ``mktor`` creates them, with support for painless cross-seeding.
19-
* ``chtor`` changes existing metafiles, e.g. to add fast-resume information.
20-
* ``hashcheck`` simply checks data against a given metafile's piece hashes.
17+
* :command:`lstor` safely lists their contents in various formats.
18+
* :command:`mktor` creates them, with support for painless cross-seeding.
19+
* :command:`chtor` changes existing metafiles, e.g. to add fast-resume information.
20+
* :command:`hashcheck` simply checks data against a given metafile's piece hashes.
2121

22-
``pyrotorque`` is a companion daemon process to rTorrent that handles
22+
:command:`pyrotorque` is a companion daemon process to rTorrent that handles
2323
automation tasks like queue management, instant metafile loading from
2424
a directory tree via file system notifications, and other background tasks.
2525

26-
``pyroadmin`` is a helper for administrative tasks (mostly configuration handling).
27-
and ``rtevent`` is experimental and incomplete.
26+
:command:`pyroadmin` is a helper for administrative tasks (mostly configuration handling).
27+
and :command:`rtevent` is experimental and incomplete.
2828

2929

3030
Bash Completion
3131
^^^^^^^^^^^^^^^
3232

33-
If you don't know what bash completion is, or want to handle this later,
33+
If you don't know what :command:`bash` completion is, or want to handle this later,
3434
you can skip to :ref:`common-options`.
3535

3636

3737
Using completion
3838
""""""""""""""""
3939

40-
In case you don't know what ``bash`` completion looks like, watch this…
40+
In case you don't know what :command:`bash` completion looks like, watch this…
4141

4242
.. image:: videos/bash-completion.gif
4343

44-
Every time you're unsure what options you have, you can press ``TAB`` twice
44+
Every time you're unsure what options you have, you can press :kbd:`TAB` twice
4545
to get a menu of choices, and if you already know roughly what you want,
46-
you can start typing and save keystrokes by pressing ``TAB`` once, to
46+
you can start typing and save keystrokes by pressing :kbd:`TAB` once, to
4747
complete whatever you provided so far.
4848

49-
So for example, enter a partial command name like ``rtco`` and then ``TAB`` to
50-
get "``rtcontrol``", then type ``--`` followed by 2 times ``TAB`` to get a list of
49+
So for example, enter a partial command name like :kbd:`rtco` and then :kbd:`TAB` to
50+
get ``rtcontrol``, then type :kbd:`--` followed by 2 times :kbd:`TAB` to get a list of
5151
possible command line options.
5252

53+
5354
Activating completion
5455
"""""""""""""""""""""
5556

56-
To add ``pyrocore``'s completion definitions to your shell, call these commands:
57+
To add `pyrocore`'s completion definitions to your shell, call these commands:
5758

5859
.. code-block:: shell
5960
@@ -67,7 +68,7 @@ After that, completion should work, see the above section for things to try out.
6768

6869
.. note::
6970

70-
On *Ubuntu*, you need to have the ``bash-completion`` package
71+
On `Ubuntu`, you need to have the ``bash-completion`` package
7172
installed on your machine. Other Linux systems will have a similar
7273
pre-condition.
7374

@@ -77,18 +78,51 @@ After that, completion should work, see the above section for things to try out.
7778
Common Options
7879
^^^^^^^^^^^^^^
7980

80-
All commands share some common options::
81+
All commands share some common options.
82+
83+
.. option:: --version
84+
85+
Show the command's version number and exit.
86+
87+
.. option:: -h, --help
88+
89+
Show the command's help information and exit.
90+
91+
.. option:: -q, --quiet
92+
93+
Omit informational logging, like the time it took to run the command.
94+
95+
.. option:: -v, --verbose
96+
97+
Increase informational logging, including some of the internal operations
98+
like configuration loading, and XMLRPC statistics.
99+
100+
.. option:: --debug
101+
102+
Always use :option:`--debug` when including logs in a bug report,
103+
since it shows stack traces for errors even when normally they'd
104+
be replaced by a more friendlier error message.
105+
106+
This option also generates even more logging output than :option:`-v`,
107+
including detailed XMLRPC diagnostics.
108+
Often it'll point you to the root of a problem, so you *don't* have to create an issue.
109+
110+
.. option:: --config-dir <DIR>
111+
112+
Use a different configuration directory instead of the :file:`~/.pyroscope` default one.
81113

82-
--version show program's version number and exit
83-
-h, --help show this help message and exit
84-
-q, --quiet omit informational logging
85-
-v, --verbose increase informational logging
86-
--debug always show stack-traces for errors
87-
--config-dir=DIR configuration directory [~/.pyroscope]
88114

89115
Also see the :ref:`cli-usage` section for an automatically generated and thus
90116
comprehensive listing of all the current options.
91117

118+
.. envvar:: PYRO_CONFIG_DIR
119+
120+
.. versionadded:: 0.6.1
121+
122+
This environment variable can be used to change the default :file:`~/.pyrocscope`
123+
of the :option:`--config-dir` option, for the duration of a shell session,
124+
or within a `systemd` unit.
125+
92126

93127
.. _mktor:
94128

0 commit comments

Comments
 (0)