suggestion for optparse

Neal D. Becker ndbecker2 at verizon.net
Thu Sep 16 07:16:24 EDT 2004


optparse is great.  I have one small suggestion for an improvement. 
optparse supports boolean switches, with action=store_false/store_true.  It
would be handy if one specification would automatically add both positive
and negative forms.

For example:

parser.add_option ("", "--limit", action="store_toggle", dest="doLimit",
default=True)

might add both

--limit

and

--no-limit





More information about the Python-list mailing list