cmdutils: Force metavar if choices are given.
This commit is contained in:
parent
dcfb52847f
commit
fc70d700b2
@ -291,6 +291,7 @@ class register: # pylint: disable=invalid-name
|
|||||||
pass
|
pass
|
||||||
elif utils.is_enum(typ):
|
elif utils.is_enum(typ):
|
||||||
kwargs['choices'] = [e.name.replace('_', '-') for e in typ]
|
kwargs['choices'] = [e.name.replace('_', '-') for e in typ]
|
||||||
|
kwargs['metavar'] = param.name
|
||||||
elif typ is bool:
|
elif typ is bool:
|
||||||
kwargs['action'] = 'store_true'
|
kwargs['action'] = 'store_true'
|
||||||
elif typ is not None:
|
elif typ is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user