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
-
subcommand *name*.
1679
+
Creates and returns a new :class:`!ArgumentParser` object for the
1680
+
subcommand *name*.
1681
1681
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``).
1682
+
The *name* argument is the name of the sub-command.
1684
1683
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).
1684
+
The *help* argument provides a short description for this sub-command.
1685
+
If provided, it will be listed next to the command in the main parser’s
1686
+
help message (e.g., ``PROG --help``).
1686
1687
1687
-
The *deprecated* argument, if :const:`True`, marks the subcommand as deprecated, which typically issues a warning when used.
1688
+
The *aliases* argument allows providing alternative names for this
1689
+
sub-command.
1688
1690
1689
-
All other keyword arguments are passed directly to the
1690
-
:class:`!ArgumentParser` constructor.
1691
+
The *deprecated* argument, if ``True``, marks the sub-command as
1692
+
deprecated and will issue a warning when used.
1691
1693
1692
-
Description of parameters:
1694
+
All other keyword arguments are passed directly to the
1695
+
:class:`!ArgumentParser` constructor.
1693
1696
1694
-
* *title* - title for the subparser group in help output; by default
1695
-
"subcommands" if description is provided, otherwise uses title for
1696
-
positional arguments
1697
+
Examples
1698
+
~~~~~~~~
1697
1699
1698
-
* *description* - description for the subparser group in help output, by
1699
-
default ``None``
1700
+
Using aliases::
1700
1701
1701
-
* *prog* - usage information that will be displayed with subcommand help,
1702
-
by default the name of the program and any positional arguments before the
1703
-
subparser argument
1704
-
1705
-
* *parser_class* - class which will be used to create subparser instances, by
1706
-
default the class of the current parser (e.g. :class:`ArgumentParser`)
1707
-
1708
-
* action_ - the basic type of action to be taken when this argument is
1709
-
encountered at the command line
1710
-
1711
-
* dest_ - name of the attribute under which subcommand name will be
1712
-
stored; by default ``None`` and no value is stored
1713
-
1714
-
* required_ - Whether or not a subcommand must be provided, by default
0 commit comments