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

  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))

  1. I would support --verbose, too