Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea320ab

Browse files
committed
Issue #9349: add argparse.SUPPRESS to help doc
1 parent 366999a commit ea320ab

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Doc/library/argparse.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,17 @@ specifiers include the program name, ``%(prog)s`` and most keyword arguments to
10511051
optional arguments:
10521052
-h, --help show this help message and exit
10531053

1054+
:mod:`argparse` supports silencing the help entry for certain options, by
1055+
setting the ``help`` value to ``argparse.SUPPRESS``::
1056+
1057+
>>> parser = argparse.ArgumentParser(prog='frobble')
1058+
>>> parser.add_argument('--foo', help=argparse.SUPPRESS)
1059+
>>> parser.print_help()
1060+
usage: frobble [-h]
1061+
1062+
optional arguments:
1063+
-h, --help show this help message and exit
1064+
10541065

10551066
metavar
10561067
^^^^^^^

0 commit comments

Comments
 (0)