summaryrefslogtreecommitdiffstats
path: root/Doc/library/argparse.rst
diff options
context:
space:
mode:
authorSandro Tosi <sandro.tosi@gmail.com>2012-01-03 17:37:03 (GMT)
committerSandro Tosi <sandro.tosi@gmail.com>2012-01-03 17:37:03 (GMT)
commitea320abcae63cadfbc5f57122822acff2bc27dd5 (patch)
tree5f2b56fb7b5ec9d493452bcc057d7a55b8a4d17e /Doc/library/argparse.rst
parent366999a0119e860d1e3137ef6bb56b3b913840f4 (diff)
downloadcpython-ea320abcae63cadfbc5f57122822acff2bc27dd5.zip
cpython-ea320abcae63cadfbc5f57122822acff2bc27dd5.tar.gz
cpython-ea320abcae63cadfbc5f57122822acff2bc27dd5.tar.bz2
Issue #9349: add argparse.SUPPRESS to help doc
Diffstat (limited to 'Doc/library/argparse.rst')
-rw-r--r--Doc/library/argparse.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index 305a546..12684db 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
^^^^^^^