From ea320abcae63cadfbc5f57122822acff2bc27dd5 Mon Sep 17 00:00:00 2001 From: Sandro Tosi Date: Tue, 3 Jan 2012 18:37:03 +0100 Subject: [PATCH] Issue #9349: add argparse.SUPPRESS to help doc --- Doc/library/argparse.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 305a546d542..12684dbb8b1 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -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 ^^^^^^^