From 98ede1b0e8c8473d6910fab2328dbc81d740945c Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Mon, 30 May 2016 10:36:48 +0200 Subject: parameters: introduce cli_metavar keyword argument Add new Param keyword argument cli_metavar to specify the stand-in for CLI option arguments in command help text. Uppercase class name is used by default. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka --- ipalib/cli.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'ipalib/cli.py') diff --git a/ipalib/cli.py b/ipalib/cli.py index 1897a3431..33e982ef9 100644 --- a/ipalib/cli.py +++ b/ipalib/cli.py @@ -1163,10 +1163,8 @@ class cli(backend.Executioner): kw['action'] = 'store_false' else: kw['action'] = 'store_true' - elif isinstance(option, Enum): - kw['metavar'] = list(str(x) for x in option.values) else: - kw['metavar'] = option.__class__.__name__.upper() + kw['metavar'] = option.cli_metavar cli_name = to_cli(option.cli_name) option_names = ['--%s' % cli_name] -- cgit