]> granicus.if.org Git - python/commitdiff
#5719: add short usage example to optparse docstring.
authorGeorg Brandl <georg@python.org>
Sun, 12 Apr 2009 20:30:53 +0000 (20:30 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 12 Apr 2009 20:30:53 +0000 (20:30 +0000)
Lib/optparse.py

index aeb5716a8757a351c5e38cf98c9cafd796188ba6..8ab329104a51b88a08153d5b082bf0991711dad6 100644 (file)
@@ -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"