mirror of
https://github.com/python/cpython.git
synced 2025-09-13 12:17:24 +00:00
Issue #9349: add argparse.SUPPRESS to help doc
This commit is contained in:
parent
366999a011
commit
ea320abcae
1 changed files with 11 additions and 0 deletions
|
@ -1051,6 +1051,17 @@ specifiers include the program name, ``%(prog)s`` and most keyword arguments to
|
|||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
|
||||
:mod:`argparse` supports silencing the help entry for certain options, by
|
||||
setting the ``help`` value to ``argparse.SUPPRESS``::
|
||||
|
||||
>>> parser = argparse.ArgumentParser(prog='frobble')
|
||||
>>> parser.add_argument('--foo', help=argparse.SUPPRESS)
|
||||
>>> parser.print_help()
|
||||
usage: frobble [-h]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
|
||||
|
||||
metavar
|
||||
^^^^^^^
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue