#6892: fix optparse example involving help option.

This commit is contained in:
Georg Brandl 2009-09-16 13:11:06 +00:00
parent d7226ffe0b
commit 718b221e06
1 changed files with 4 additions and 1 deletions

View File

@ -1019,7 +1019,10 @@ must specify for any option using that action.
from optparse import OptionParser, SUPPRESS_HELP 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("-h", "--help", action="help")
parser.add_option("-v", action="store_true", dest="verbose", parser.add_option("-v", action="store_true", dest="verbose",
help="Be moderately verbose") help="Be moderately verbose")