diff options
author | Georg Brandl <georg@python.org> | 2009-09-16 13:11:06 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-09-16 13:11:06 (GMT) |
commit | 718b221e06e0e4a5b2ecb43f383b6752bc5631d7 (patch) | |
tree | af862a58ad5a674f499701eabe341e77ff631c10 /Doc | |
parent | d7226ffe0b9adf6d61fd9d1546f6e9a5e0964890 (diff) | |
download | cpython-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.rst | 5 |
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") |