You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates and returns a new :class:`!ArgumentParser` object for the
1680
1680
subcommand *name*.
1681
1681
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``).
1684
1684
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).
1686
1686
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.
1688
1688
All other keyword arguments are passed directly to the
1689
1689
:class:`!ArgumentParser` constructor.
1690
1690
This returned :class:`!ArgumentParser` object can be modified as usual.
1691
1691
1692
1692
Description of parameters:
1693
1693
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
1695
1695
"subcommands" if description is provided, otherwise uses title for
1696
1696
positional arguments
1697
1697
1698
-
* *description* - description for the sub-parser group in help output, by
1698
+
* *description* - description for the subparser group in help output, by
1699
1699
default ``None``
1700
1700
1701
-
* *prog* - usage information that will be displayed with sub-command help,
1701
+
* *prog* - usage information that will be displayed with subcommand help,
1702
1702
by default the name of the program and any positional arguments before the
1703
1703
subparser argument
1704
1704
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
1706
1706
default the class of the current parser (e.g. :class:`ArgumentParser`)
1707
1707
1708
1708
* action_ - the basic type of action to be taken when this argument is
1709
1709
encountered at the command line
1710
1710
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
1712
1712
stored; by default ``None`` and no value is stored
1713
1713
1714
1714
* required_ - Whether or not a subcommand must be provided, by default
1715
1715
``False`` (added in 3.7)
1716
1716
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``
1718
1718
1719
1719
* metavar_ - string presenting available subcommands in help; by default it
1720
1720
is ``None`` and presents subcommands in form {cmd1, cmd2, ..}
@@ -2254,7 +2254,7 @@ Registering custom types or actions
2254
2254
2255
2255
Sometimes it's desirable to use a custom string in error messages to provide
2256
2256
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
2258
2258
type by their registered name instead of their callable name.
2259
2259
2260
2260
The :meth:`!register` method accepts three arguments - a *registry_name*,
0 commit comments