Add built-in types support for 'type' argument in the actions map

This commit is contained in:
Jerome Lebleu 2014-03-26 23:34:19 +01:00
parent 0e2281de43
commit 13213025a1

View file

@ -519,6 +519,9 @@ class ActionsMap(object):
for argn, argp in arguments.items():
names = top_parser.format_arg_names(argn,
argp.pop('full', None))
try: argp['type'] = eval(argp['type'])
except: pass
try:
extra = argp.pop('extra')
arg_dest = (parser.add_argument(*names, **argp)).dest