# HG changeset patch # User Jeff Hammel # Date 1333126006 25200 # Node ID 5f31e56eebb66e103ae148c7d8537492a7eebb50 # Parent 406183d93e48d7da9e8c089dcd9c853c7d1f8110 add some int support diff -r 406183d93e48 -r 5f31e56eebb6 commandparser/command.py --- a/commandparser/command.py Fri Mar 30 09:13:06 2012 -0700 +++ b/commandparser/command.py Fri Mar 30 09:46:46 2012 -0700 @@ -227,6 +227,10 @@ elif value is False: parser.add_option('--%s' % key, action='store_true', default=False, help=help) + elif isinstance(value, int): + help += ' [DEFAULT: %s]' % value + parser.add_option('--%s' % key, help=help, + type='int', default=value) elif type(value) in set([type(()), type([])]): if value: help += ' [DEFAULT: %s]' % value