From aa48157d3da1ce587f6fb99dced18014b85215dc Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 12 Apr 2009 20:30:53 +0000 Subject: #5719: add short usage example to optparse docstring. --- Lib/optparse.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Lib/optparse.py b/Lib/optparse.py index aeb5716..8ab3291 100644 --- a/Lib/optparse.py +++ b/Lib/optparse.py @@ -6,6 +6,19 @@ Originally distributed as Optik. For support, use the optik-users@lists.sourceforge.net mailing list (http://lists.sourceforge.net/lists/listinfo/optik-users). + +Simple usage example: + + from optparse import OptionParser + + parser = OptionParser() + parser.add_option("-f", "--file", dest="filename", + help="write report to FILE", metavar="FILE") + parser.add_option("-q", "--quiet", + action="store_false", dest="verbose", default=True, + help="don't print status messages to stdout") + + (options, args) = parser.parse_args() """ __version__ = "1.5.3" -- cgit v0.12