mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
#6892: fix optparse example involving help option.
This commit is contained in:
parent
d7226ffe0b
commit
718b221e06
1 changed files with 4 additions and 1 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue