Add ArgParser default help (if not provided)

This commit is contained in:
allegroai 2020-09-29 19:15:11 +03:00
parent 2065288a90
commit cd77f0b8c8

View File

@ -102,7 +102,11 @@ class _Arguments(object):
for a in actions for a in actions
} }
desc_ = {a.dest: a.help for a in actions} desc_ = {
a.dest: a.help or (
'{}default: {}'.format('choices: {}, '.format(a.choices) if a.choices else '',
defaults_.get(a.dest, '')))
for a in actions}
descriptions.update(desc_) descriptions.update(desc_)
types_ = {a.dest: (a.type or None) for a in actions} types_ = {a.dest: (a.type or None) for a in actions}
arg_types.update(types_) arg_types.update(types_)