]> granicus.if.org Git - python/commitdiff
#6892: fix optparse example involving help option.
authorGeorg Brandl <georg@python.org>
Wed, 16 Sep 2009 13:11:06 +0000 (13:11 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 16 Sep 2009 13:11:06 +0000 (13:11 +0000)
Doc/library/optparse.rst

index 181994ecd15ce23be1e5a142320ed027152fa4b9..7bd7b4e4f219a06dce3619fa38f9c6258cc763e3 100644 (file)
@@ -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")