User Tools

Site Tools


python:optparse

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
python:optparse [2010/03/15 12:11]
tkbletsc
python:optparse [2011/03/03 11:31]
tkbletsc
Line 8: Line 8:
 } }
 parser = OptionParser("​Usage:​ %prog [options] <files ...>"​) parser = OptionParser("​Usage:​ %prog [options] <files ...>"​)
 +
 +# uncomment if you need to ignore options after the first argument, e.g. "​mywrapper -x ls -l"
 +# parser.disable_interspersed_args()
  
 parser.add_option("​-n",​ "​--number",​ dest="​number",​ help="​Quantity of things",​ metavar="​NUM",​ type="​int"​) parser.add_option("​-n",​ "​--number",​ dest="​number",​ help="​Quantity of things",​ metavar="​NUM",​ type="​int"​)
python/optparse.txt ยท Last modified: 2011/06/05 17:40 by tkbletsc