cli: Add mechanism for deprecated option name aliases

Add a new Param kwarg, deprecated_cli_aliases, that lists
deprecated aliases.
The aliases will appear in a "Deprecated options" in the help,
and otherwise act as the normal variant.

Preparation for: https://fedorahosted.org/freeipa/ticket/4231
This commit is contained in:
Petr Viktorin
2014-03-18 10:11:19 +01:00
parent 84c401f7d6
commit ffd9bb2d7c
2 changed files with 29 additions and 13 deletions

View File

@@ -300,6 +300,7 @@ class Param(ReadOnly):
- cli_name: option name in CLI
- cli_short_name: one character version of cli_name
- deprecated_cli_aliases: deprecated CLI aliases
- label: very short description of the parameter. This value is used in
when the Command output is printed to CLI or in a Command help
- doc: parameter long description used in help
@@ -384,6 +385,7 @@ class Param(ReadOnly):
kwargs = (
('cli_name', str, None),
('cli_short_name', str, None),
('deprecated_cli_aliases', frozenset, frozenset()),
('label', (basestring, Gettext), None),
('doc', (basestring, Gettext), None),
('required', bool, True),