From: Sandro Tosi Date: Tue, 3 Jan 2012 17:31:51 +0000 (+0100) Subject: Issue #9349: add argparse.SUPPRESS to help doc X-Git-Tag: v2.7.3rc1~196 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=711f54798ce33f1a697d3f1c0c941ac56ba40316;p=thirdparty%2FPython%2Fcpython.git Issue #9349: add argparse.SUPPRESS to help doc --- diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 38e3f3ee7a4a..5ad36c7e9fc1 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 ^^^^^^^