mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Unroll StrEnum values when displaying help
https://fedorahosted.org/freeipa/ticket/1848
This commit is contained in:
parent
844d4ff8bf
commit
8f5d806b81
@ -48,7 +48,7 @@ import plugable
|
||||
import util
|
||||
from errors import PublicError, CommandError, HelpError, InternalError, NoSuchNamespaceError, ValidationError, NotFound, NotConfiguredError
|
||||
from constants import CLI_TAB
|
||||
from parameters import Password, Bytes, File, Str
|
||||
from parameters import Password, Bytes, File, Str, StrEnum
|
||||
from text import _
|
||||
from ipapython.version import API_VERSION
|
||||
|
||||
@ -1008,8 +1008,11 @@ class cli(backend.Executioner):
|
||||
kw['action'] = 'store_false'
|
||||
else:
|
||||
kw['action'] = 'store_true'
|
||||
elif isinstance(option, StrEnum):
|
||||
kw['metavar'] = metavar=map(lambda x: str(x), option.values)
|
||||
else:
|
||||
kw['metavar'] = metavar=option.__class__.__name__.upper()
|
||||
|
||||
if option.cli_short_name:
|
||||
o = optparse.make_option('-%s' % option.cli_short_name, '--%s' % to_cli(option.cli_name), **kw)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user