From 718b221e06e0e4a5b2ecb43f383b6752bc5631d7 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 16 Sep 2009 13:11:06 +0000 Subject: [PATCH] #6892: fix optparse example involving help option. --- Doc/library/optparse.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst index 181994ecd15..7bd7b4e4f21 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")