Update order of help option in docs

This commit is contained in:
Paul Ouellette
2019-08-14 21:32:34 -04:00
parent 70bfe6c31f
commit f72c10d21a
6 changed files with 33 additions and 33 deletions

View File

@@ -64,7 +64,7 @@ $ lua script.lua foo bar
``` ```
``` ```
Usage: script [-o <output>] [-I <include>] [-h] <input> Usage: script [-h] [-o <output>] [-I <include>] <input>
Error: too many arguments Error: too many arguments
``` ```
@@ -74,7 +74,7 @@ $ lua script.lua --help
``` ```
``` ```
Usage: script [-o <output>] [-I <include>] [-h] <input> Usage: script [-h] [-o <output>] [-I <include>] <input>
An example. An example.
@@ -82,11 +82,11 @@ Arguments:
input Input file. input Input file.
Options: Options:
-h, --help Show this help message and exit.
-o <output>, --output <output> -o <output>, --output <output>
Output file. (default: a.out) Output file. (default: a.out)
-I <include>, --include <include> -I <include>, --include <include>
Include locations. Include locations.
-h, --help Show this help message and exit.
``` ```
```bash ```bash
@@ -94,7 +94,7 @@ $ lua script.lua foo --outptu=bar
``` ```
``` ```
Usage: script [-o <output>] [-I <include>] [-h] <input> Usage: script [-h] [-o <output>] [-I <include>] <input>
Error: unknown option '--outptu' Error: unknown option '--outptu'
Did you mean '--output'? Did you mean '--output'?

View File

@@ -31,7 +31,7 @@ argparse can perform automatic validation and conversion on arguments. If ``conv
.. code-block:: none .. code-block:: none
Usage: script.lua [-t <times>] [-h] <input> Usage: script.lua [-h] [-t <times>] <input>
Error: nonexistent.txt: No such file or directory Error: nonexistent.txt: No such file or directory
@@ -41,7 +41,7 @@ argparse can perform automatic validation and conversion on arguments. If ``conv
.. code-block:: none .. code-block:: none
Usage: script.lua [-t <times>] [-h] <input> Usage: script.lua [-h] [-t <times>] <input>
Error: malformed argument 'many' Error: malformed argument 'many'

View File

@@ -91,7 +91,7 @@ Commands have their own usage and help messages.
.. code-block:: none .. code-block:: none
Usage: script.lua install [-f <from>] [-h] <rock> Usage: script.lua install [-h] [-f <from>] <rock>
Error: too few arguments Error: too few arguments
@@ -101,14 +101,14 @@ Commands have their own usage and help messages.
.. code-block:: none .. code-block:: none
Usage: script.lua install [-f <from>] [-h] <rock> Usage: script.lua install [-h] [-f <from>] <rock>
Arguments: Arguments:
rock rock
Options: Options:
-f <from>, --from <from>
-h, --help Show this help message and exit. -h, --help Show this help message and exit.
-f <from>, --from <from>
Making a command optional Making a command optional
------------------------- -------------------------

View File

@@ -30,12 +30,12 @@ The existence of a default value is reflected in help message, unless ``show_def
.. code-block:: none .. code-block:: none
Usage: script.lua [-o <output>] [-h] Usage: script.lua [-h] [-o <output>]
Options: Options:
-h, --help Show this help message and exit.
-o <output>, --output <output> -o <output>, --output <output>
Output file. (default: a.out) Output file. (default: a.out)
-h, --help Show this help message and exit.
Note that invocation without required arguments is still an error. Note that invocation without required arguments is still an error.
@@ -45,7 +45,7 @@ Note that invocation without required arguments is still an error.
.. code-block:: none .. code-block:: none
Usage: script.lua [-o <output>] [-h] Usage: script.lua [-h] [-o <output>]
Error: too few arguments Error: too few arguments
@@ -76,12 +76,12 @@ Consider the difference:
.. code-block:: none .. code-block:: none
Usage: script.lua [-o <o>] [-p [<p>]] [-h] Usage: script.lua [-h] [-o <o>] [-p [<p>]]
Options: Options:
-h, --help Show this help message and exit.
-o <o> default: a.out -o <o> default: a.out
-p [<p>] default: password -p [<p>] default: password
-h, --help Show this help message and exit.
.. code-block:: none .. code-block:: none
@@ -111,6 +111,6 @@ Consider the difference:
.. code-block:: none .. code-block:: none
Usage: script.lua [-o <o>] [-p [<p>]] [-h] Usage: script.lua [-h] [-o <o>] [-p [<p>]]
Error: too few arguments Error: too few arguments

View File

@@ -23,11 +23,11 @@ it is not included into help and usage messages, but otherwise works normally.
.. code-block:: none .. code-block:: none
Usage: script.lua [--normal-option <normal_option>] [-h] Usage: script.lua [-h] [--normal-option <normal_option>]
Options: Options:
--normal-option <normal_option>
-h, --help Show this help message and exit. -h, --help Show this help message and exit.
--normal-option <normal_option>
.. code-block:: none .. code-block:: none
@@ -57,11 +57,11 @@ For options and arguments, ``argname`` property controls the placeholder for the
.. code-block:: none .. code-block:: none
Usage: script.lua [-f <server>] [-h] Usage: script.lua [-h] [-f <server>]
Options: Options:
-f <server>, --from <server>
-h, --help Show this help message and exit. -h, --help Show this help message and exit.
-f <server>, --from <server>
``argname`` can be an array of placeholders. ``argname`` can be an array of placeholders.
@@ -78,11 +78,11 @@ For options and arguments, ``argname`` property controls the placeholder for the
.. code-block:: none .. code-block:: none
Usage: script.lua [--pair <key> <value>] [-h] Usage: script.lua [-h] [--pair <key> <value>]
Options: Options:
--pair <key> <value>
-h, --help Show this help message and exit. -h, --help Show this help message and exit.
--pair <key> <value>
Grouping elements Grouping elements
----------------- -----------------
@@ -113,9 +113,9 @@ a named group with its own section in the help message. Elements outside any gro
.. code-block:: none .. code-block:: none
Usage: script.lua [-v] [--use-colors] [--encoding <encoding>] Usage: script.lua [-h] [-v] [--use-colors] [--encoding <encoding>]
[--compression-level <compression_level>] [--compression-level <compression_level>]
[--skip-broken-chunks] [--version] [-h] [--skip-broken-chunks] [--version]
Configuring output format: Configuring output format:
-v, --verbose -v, --verbose
@@ -127,8 +127,8 @@ a named group with its own section in the help message. Elements outside any gro
--skip-broken-chunks --skip-broken-chunks
Other options: Other options:
--version
-h, --help Show this help message and exit. -h, --help Show this help message and exit.
--version
Help message line wrapping Help message line wrapping
-------------------------- --------------------------
@@ -167,9 +167,10 @@ and the continuation lines are aligned with the first word after the list item m
.. code-block:: none .. code-block:: none
Usage: script.lua [-f <foo>] [-b <bar>] [-h] Usage: script.lua [-h] [-f <foo>] [-b <bar>]
Options: Options:
-h, --help Show this help message and exit.
-f <foo>, Lorem ipsum dolor sit amet, consectetur adipiscing -f <foo>, Lorem ipsum dolor sit amet, consectetur adipiscing
--foo <foo> elit, sed do eiusmod tempor incididunt ut labore et --foo <foo> elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis dolore magna aliqua. Ut enim ad minim veniam, quis
@@ -188,7 +189,6 @@ and the continuation lines are aligned with the first word after the list item m
ullamco laboris nisi ut aliquip... ullamco laboris nisi ut aliquip...
* Duis aute irure dolor in reprehenderit in voluptate * Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. velit esse cillum dolore eu fugiat nulla pariatur.
-h, --help Show this help message and exit.
``help_max_width`` property is inherited by commands. ``help_max_width`` property is inherited by commands.
@@ -221,8 +221,8 @@ Like ``help_max_width``, all of them are inherited by commands when set on the p
.. code-block:: none .. code-block:: none
Usage: script.lua [--foo <foo>] [--bar <bar>] Usage: script.lua [-h] [--foo <foo>] [--bar <bar>]
[--baz <baz>] [--qux <qux>] [-h] [--baz <baz>] [--qux <qux>]
Help message for a group of arguments, options, or commands is organized into two columns, with usage Help message for a group of arguments, options, or commands is organized into two columns, with usage
template on the left side and descriptions on the right side. template on the left side and descriptions on the right side.
@@ -250,11 +250,13 @@ within a group (``0`` by default).
.. code-block:: none .. code-block:: none
Usage: script.lua [--foo <foo>] [--bar <bar>] [--baz <baz>] Usage: script.lua [-h] [--foo <foo>] [--bar <bar>] [--baz <baz>]
[--qux <qux>] [-h] [--qux <qux>]
Options: Options:
-h, --help Show this help message and exit.
--foo <foo> Set foo. --foo <foo> Set foo.
--bar <bar> Set bar. --bar <bar> Set bar.
@@ -262,5 +264,3 @@ within a group (``0`` by default).
--baz <baz> Set baz. --baz <baz> Set baz.
--qux <qux> Set qux. --qux <qux> Set qux.
-h, --help Show this help message and exit.

View File

@@ -127,7 +127,7 @@ Set ``overwrite`` property to ``false`` to prohibit this behavior.
.. code-block:: none .. code-block:: none
Usage: script.lua [-o <output>] [-h] Usage: script.lua [-h] [-o <output>]
Error: option '-o' must be used at most 1 time Error: option '-o' must be used at most 1 time