Automatically add default values for options which have them.

pull/45/head
Zach Riggle 10 years ago
parent 27b4a9a314
commit 14cbea1945

@ -140,9 +140,10 @@ class ArgparsedCommand(object):
for action in parser._actions: for action in parser._actions:
if action.dest == 'help': if action.dest == 'help':
continue continue
if action.type not in (int, None): if action.type in (int, None):
continue action.type = fix_int
action.type = fix_int if action.default is not None:
action.help += ' (default: %(default)s)'
def __call__(self, function): def __call__(self, function):
self.parser.prog = function.__name__ self.parser.prog = function.__name__

Loading…
Cancel
Save