diff options
author | Sandro Tosi <sandro.tosi@gmail.com> | 2012-01-03 17:31:51 (GMT) |
---|---|---|
committer | Sandro Tosi <sandro.tosi@gmail.com> | 2012-01-03 17:31:51 (GMT) |
commit | 711f54798ce33f1a697d3f1c0c941ac56ba40316 (patch) | |
tree | 0171dd4c4849146a36f85376185a4d8e0f275ad3 /Doc | |
parent | 3aa59e327c76e7317a2776ead387fdb33aebe7e5 (diff) | |
download | cpython-711f54798ce33f1a697d3f1c0c941ac56ba40316.zip cpython-711f54798ce33f1a697d3f1c0c941ac56ba40316.tar.gz cpython-711f54798ce33f1a697d3f1c0c941ac56ba40316.tar.bz2 |
Issue #9349: add argparse.SUPPRESS to help doc
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/argparse.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 38e3f3e..5ad36c7 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1049,6 +1049,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 ^^^^^^^ |