summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-09-16 13:11:06 (GMT)
committerGeorg Brandl <georg@python.org>2009-09-16 13:11:06 (GMT)
commit718b221e06e0e4a5b2ecb43f383b6752bc5631d7 (patch)
treeaf862a58ad5a674f499701eabe341e77ff631c10 /Doc
parentd7226ffe0b9adf6d61fd9d1546f6e9a5e0964890 (diff)
downloadcpython-718b221e06e0e4a5b2ecb43f383b6752bc5631d7.zip
cpython-718b221e06e0e4a5b2ecb43f383b6752bc5631d7.tar.gz
cpython-718b221e06e0e4a5b2ecb43f383b6752bc5631d7.tar.bz2
#6892: fix optparse example involving help option.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/optparse.rst5
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst
index 181994e..7bd7b4e 100644
--- a/Doc/library/optparse.rst
+++ b/Doc/library/optparse.rst
@@ -1019,7 +1019,10 @@ must specify for any option using that action.
from optparse import OptionParser, SUPPRESS_HELP
- parser = OptionParser()
+ # usually, a help option is added automatically, but that can
+ # be suppressed using the add_help_option argument
+ parser = OptionParser(add_help_option=False)
+
parser.add_option("-h", "--help", action="help")
parser.add_option("-v", action="store_true", dest="verbose",
help="Be moderately verbose")