[Python-checkins] cpython (merge 3.2 -> default): merge with 3.2

sandro.tosi python-checkins at python.org
Tue Jan 3 18:39:11 CET 2012


http://hg.python.org/cpython/rev/f38182db6c7a
changeset:   74244:f38182db6c7a
parent:      74241:120a79b8bb11
parent:      74242:572ddf2770bc
user:        Sandro Tosi <sandro.tosi at gmail.com>
date:        Tue Jan 03 18:37:46 2012 +0100
summary:
  merge with 3.2

files:
  Doc/library/argparse.rst |  11 +++++++++++
  1 files changed, 11 insertions(+), 0 deletions(-)


diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -1070,6 +1070,17 @@
    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
 ^^^^^^^

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list