cmdutils: Force metavar if choices are given.

This commit is contained in:
Florian Bruhin 2014-09-07 21:06:36 +02:00
parent dcfb52847f
commit fc70d700b2

View File

@ -291,6 +291,7 @@ class register: # pylint: disable=invalid-name
pass
elif utils.is_enum(typ):
kwargs['choices'] = [e.name.replace('_', '-') for e in typ]
kwargs['metavar'] = param.name
elif typ is bool:
kwargs['action'] = 'store_true'
elif typ is not None: