Skip to content

Commit 2dd07bb

Browse files
Fixing the issue as requested
1 parent 1a5c449 commit 2dd07bb

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

Doc/library/argparse.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ The Namespace object
16561656
Other utilities
16571657
---------------
16581658

1659-
Sub-commands
1659+
Subcommands
16601660
^^^^^^^^^^^^
16611661

16621662
.. method:: ArgumentParser.add_subparsers(*, [title], [description], [prog], \
@@ -1679,42 +1679,42 @@ Sub-commands
16791679
Creates and returns a new :class:`!ArgumentParser` object for the
16801680
subcommand *name*.
16811681

1682-
The *name* argument is the name of the sub-command.
1683-
The *help* argument provides a short description for this sub-command. If provided, it will be listed next to the command in the main parser's help message (e.g., ``PROG --help``).
1682+
The *name* argument is the name of the subcommand.
1683+
The *help* argument provides a short description for this subcommand. If provided, it will be listed next to the command in the main parser's help message (e.g., ``PROG --help``).
16841684

1685-
The *aliases* argument allows to provide a sequence of strings that can be used as alternative names for this sub-command (e.g., ``aliases=['r']`` for a ``'run'`` command).
1685+
The *aliases* argument allows to provide a sequence of strings that can be used as alternative names for this subcommand (e.g., ``aliases=['r']`` for a ``'run'`` command).
16861686

1687-
The *deprecated* argument, if :const:`True`, marks the sub-command as deprecated, which typically issues a warning when used.
1687+
The *deprecated* argument, if :const:`True`, marks the subcommand as deprecated, which typically issues a warning when used.
16881688
All other keyword arguments are passed directly to the
16891689
:class:`!ArgumentParser` constructor.
16901690
This returned :class:`!ArgumentParser` object can be modified as usual.
16911691

16921692
Description of parameters:
16931693

1694-
* *title* - title for the sub-parser group in help output; by default
1694+
* *title* - title for the subparser group in help output; by default
16951695
"subcommands" if description is provided, otherwise uses title for
16961696
positional arguments
16971697

1698-
* *description* - description for the sub-parser group in help output, by
1698+
* *description* - description for the subparser group in help output, by
16991699
default ``None``
17001700

1701-
* *prog* - usage information that will be displayed with sub-command help,
1701+
* *prog* - usage information that will be displayed with subcommand help,
17021702
by default the name of the program and any positional arguments before the
17031703
subparser argument
17041704

1705-
* *parser_class* - class which will be used to create sub-parser instances, by
1705+
* *parser_class* - class which will be used to create subparser instances, by
17061706
default the class of the current parser (e.g. :class:`ArgumentParser`)
17071707

17081708
* action_ - the basic type of action to be taken when this argument is
17091709
encountered at the command line
17101710

1711-
* dest_ - name of the attribute under which sub-command name will be
1711+
* dest_ - name of the attribute under which subcommand name will be
17121712
stored; by default ``None`` and no value is stored
17131713

17141714
* required_ - Whether or not a subcommand must be provided, by default
17151715
``False`` (added in 3.7)
17161716

1717-
* help_ - help for sub-parser group in help output, by default ``None``
1717+
* help_ - help for subparser group in help output, by default ``None``
17181718

17191719
* metavar_ - string presenting available subcommands in help; by default it
17201720
is ``None`` and presents subcommands in form {cmd1, cmd2, ..}
@@ -2254,7 +2254,7 @@ Registering custom types or actions
22542254

22552255
Sometimes it's desirable to use a custom string in error messages to provide
22562256
more user-friendly output. In these cases, :meth:`!register` can be used to
2257-
register custom actions or types with a parser and allow you to reference the
2257+
register custom actions or types with a parser anto reference the
22582258
type by their registered name instead of their callable name.
22592259

22602260
The :meth:`!register` method accepts three arguments - a *registry_name*,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Document ``help`` and ``aliases`` parameters for
2+
``argparse._SubParsersAction.add_parser`` in the :mod:`argparse`
3+
documentation.

0 commit comments

Comments
 (0)