Skip to content

Commit 1bad1f2

Browse files
gh-58247: clarify metavar behaviour in ArgumentParser.add_subparsers (#148671)
Co-authored-by: Savannah Ostrowski <savannah@python.org>
1 parent 49aed47 commit 1bad1f2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎Doc/library/argparse.rst‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,8 +1771,9 @@ Subcommands
17711771

17721772
* help_ - help for sub-parser group in help output, by default ``None``
17731773

1774-
* metavar_ - string presenting available subcommands in help; by default it
1775-
is ``None`` and presents subcommands in form {cmd1, cmd2, ..}
1774+
* metavar_ - placeholder shown in usage and the subparsers' help entry
1775+
instead of ``{cmd1, cmd2, ...}``; by default ``None``.
1776+
Individual subcommand names are unchanged.
17761777

17771778
Some example usage::
17781779

0 commit comments

Comments
 (0)