From 2b6d5536d7b300bab4a1afd3382536ef178fc432 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 4 May 2023 18:15:31 +0200 Subject: [PATCH] Fix docstrings RST markup in `ansible-console` CLI module (#80719) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 📝🐛 Fix RST list @ `ansible-console` manpage Said CLI entrypoint docstring is used to construct the corresponding manpage. `docutils` were producing the following warning with the current RST markup used there, as follows: :36: (WARNING/2) Bullet list ends without a blank line; unexpected unindent. This change puts a portion of the first list entry on a separate line which allows the RST parser stomach it without any problems and produce correct output without gibberish in it. * 🎨📝 Use RST inline code @ ansible-console doc The single backtick syntax was causing things to be interpreted as italics text. The inline code needs double backticks. --- lib/ansible/cli/console.py | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/lib/ansible/cli/console.py b/lib/ansible/cli/console.py index 18f38a4649d..2325bf05d6d 100755 --- a/lib/ansible/cli/console.py +++ b/lib/ansible/cli/console.py @@ -39,26 +39,30 @@ class ConsoleCLI(CLI, cmd.Cmd): ''' A REPL that allows for running ad-hoc tasks against a chosen inventory from a nice shell with built-in tab completion (based on dominis' - ansible-shell). + ``ansible-shell``). It supports several commands, and you can modify its configuration at runtime: - - `cd [pattern]`: change host/group (you can use host patterns eg.: app*.dc*:!app01*) - - `list`: list available hosts in the current path - - `list groups`: list groups included in the current path - - `become`: toggle the become flag - - `!`: forces shell module instead of the ansible module (!yum update -y) - - `verbosity [num]`: set the verbosity level - - `forks [num]`: set the number of forks - - `become_user [user]`: set the become_user - - `remote_user [user]`: set the remote_user - - `become_method [method]`: set the privilege escalation method - - `check [bool]`: toggle check mode - - `diff [bool]`: toggle diff mode - - `timeout [integer]`: set the timeout of tasks in seconds (0 to disable) - - `help [command/module]`: display documentation for the command or module - - `exit`: exit ansible-console + - ``cd [pattern]``: change host/group + (you can use host patterns eg.: ``app*.dc*:!app01*``) + - ``list``: list available hosts in the current path + - ``list groups``: list groups included in the current path + - ``become``: toggle the become flag + - ``!``: forces shell module instead of the ansible module + (``!yum update -y``) + - ``verbosity [num]``: set the verbosity level + - ``forks [num]``: set the number of forks + - ``become_user [user]``: set the become_user + - ``remote_user [user]``: set the remote_user + - ``become_method [method]``: set the privilege escalation method + - ``check [bool]``: toggle check mode + - ``diff [bool]``: toggle diff mode + - ``timeout [integer]``: set the timeout of tasks in seconds + (0 to disable) + - ``help [command/module]``: display documentation for + the command or module + - ``exit``: exit ``ansible-console`` ''' name = 'ansible-console'