[Python-checkins] python/dist/src/Doc/lib libgetopt.tex,1.19,1.19.8.1
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
Mon, 28 Apr 2003 21:37:15 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv29614
Modified Files:
Tag: release22-maint
libgetopt.tex
Log Message:
SF bug #729096: getopt online documentation example improvement
A newbie found it difficult to translate the exampe into a
case that used only short options or long options but not both.
He tried to shorten the tuple search but forgot the trailing comma,
The appropriate pattern is an equality check.
Revised the example to point him in the right direction.
Index: libgetopt.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgetopt.tex,v
retrieving revision 1.19
retrieving revision 1.19.8.1
diff -C2 -d -r1.19 -r1.19.8.1
*** libgetopt.tex 20 Oct 2001 04:24:09 -0000 1.19
--- libgetopt.tex 29 Apr 2003 04:37:13 -0000 1.19.8.1
***************
*** 112,116 ****
def main():
try:
! opts, args = getopt.getopt(sys.argv[1:], "ho:", ["help", "output="])
except getopt.GetoptError:
# print help information and exit:
--- 112,116 ----
def main():
try:
! opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="])
except getopt.GetoptError:
# print help information and exit:
***************
*** 118,122 ****
--- 118,125 ----
sys.exit(2)
output = None
+ verbose = False
for o, a in opts:
+ if o == "-v":
+ verbose = True
if o in ("-h", "--help"):
usage()