diff options
author | Georg Brandl <georg@python.org> | 2009-04-12 20:30:53 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-04-12 20:30:53 (GMT) |
commit | aa48157d3da1ce587f6fb99dced18014b85215dc (patch) | |
tree | 69e1fb5196427b3dbf2a7e74ac9ec9f7d239194d | |
parent | 457fefc3f80bfb2f22ad6a5e51055e9ee330c5a5 (diff) | |
download | cpython-aa48157d3da1ce587f6fb99dced18014b85215dc.zip cpython-aa48157d3da1ce587f6fb99dced18014b85215dc.tar.gz cpython-aa48157d3da1ce587f6fb99dced18014b85215dc.tar.bz2 |
#5719: add short usage example to optparse docstring.
-rw-r--r-- | Lib/optparse.py | 13 |
1 files changed, 13 insertions, 0 deletions
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" |