Issue 1601630: getopt Documentation improvement (original) (raw)
Hi,
I think the documentation of getopt could be improved
The example at the buttom: http://docs.python.org/lib/module-getopt.html
Print str(exc) except getopt.GetoptError, exc: print str(exc) usage()
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))
- I would support --verbose, too