Bugs item #1601630, was opened at 2006-11-23 09:39
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1601630&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Thomas Guettler (guettli)
>Assigned to: Georg Brandl (gbrandl)
Summary: getopt Documentation improvement

Initial Comment:
Hi,

I think the documentation of getopt could be
improved 

The example at the buttom:
http://docs.python.org/lib/module-getopt.html

1. Print str(exc)
except getopt.GetoptError, exc:
print str(exc)
usage()

2. In the loop: use elif and else

for o, a in opts:
    if o == "-v":
        verbose = True
    elif o in ("-h", "--help"):
        usage()
        sys.exit()
    else:
        raise AssertionError(
    "Unparsed Paremter: %s %s" %(o, a))

3. I would support --verbose, too



----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2006-11-23 09:55

Message:
Logged In: YES 
user_id=849994
Originator: NO

Thanks, committed something along your lines in rev. 52833, 52834 (2.5).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1601630&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to