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
Copy file name to clipboardExpand all lines: Doc/library/argparse.rst
+7-11Lines changed: 7 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1679,18 +1679,14 @@ Sub-commands
1679
1679
Creates and returns a new :class:`!ArgumentParser` object for the
1680
1680
subcommand *name*.
1681
1681
1682
-
:param name: The name of the sub-command.
1683
-
:param help: A short description for this sub-command. If provided,
1684
-
it will be listed next to the command in the main
1685
-
parser's help message (e.g., ``PROG --help``).
1686
-
:param aliases: A list or sequence of strings that can be used as
1687
-
alternative names for this sub-command (e.g., ``aliases=['r']``
1688
-
for a ``'run'`` command).
1689
-
:param deprecated: If :const:`True`, marks the sub-command as deprecated,
1690
-
which typically issues a warning when used.
1691
-
:param kwargs: All other keyword arguments are passed directly to the
1692
-
:class:`!ArgumentParser` constructor.
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``).
1693
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).
1686
+
1687
+
The *deprecated* argument, if :const:`True`, marks the sub-command as deprecated, which typically issues a warning when used.
1688
+
All other keyword arguments are passed directly to the
1689
+
:class:`!ArgumentParser` constructor.
1694
1690
This returned :class:`!ArgumentParser` object can be modified as usual.
0 commit comments