Hi,
when help is displayed, for options that require values we show their
type. With string enumerations this does not really help to the user
as it is unclear what are the values of the enumeration.

Advertising

Attached patch fixes it by providing nicer list of possible values.
https://fedorahosted.org/freeipa/ticket/1848
As result, instead of what is shown in the ticket:
------------------------------------------------------------
[root@kungfupanda ~]# ipa help hbacrule-add
Purpose: Create a new HBAC rule.
Usage: ipa [global-options] hbacrule-add NAME [options]
Options:
-h, --help show this help message and exit
--usercat=STRENUM User category the rule applies to
--hostcat=STRENUM Host category the rule applies to
--srchostcat=STRENUM Source host category the rule applies to
--servicecat=STRENUM Service category the rule applies to
-------------------------------------------------------------
one would get following:
------------------------------------------------------------
[root@kungfupanda ~]# ipa help hbacrule-add
Purpose: Create a new HBAC rule.
Usage: ipa [global-options] hbacrule-add NAME [options]
Options:
-h, --help show this help message and exit
--usercat=['all'] User category the rule applies to
--hostcat=['all'] Host category the rule applies to
--srchostcat=['all'] Source host category the rule applies to
--servicecat=['all'] Service category the rule applies to
------------------------------------------------------------
It becomes even more reasonable with type or class options -- overall
we have 65 StrEnums in current set of options.
For example, in dnsrecord-add --class option was shown as
--class=STRENUM DNS class
With the patch attached it will be more understandable:
------------------------------------------------------------
[root@host3 ~]# ipa help dnsrecord-add
Purpose: Add new DNS resource record.
Usage: ipa [global-options] dnsrecord-add DNSZONE NAME [options]
Options:
-h, --help show this help message and exit
--ttl=INT Time to live
--class=['IN', 'CS', 'CH', 'HS']
DNS class
--addattr=STR Add an attribute/value pair. Format is attr=value. The
attribute must be part of the schema.
--setattr=STR Set an attribute to a name/value pair. Format is
attr=value. For multi-valued attributes, the command
replaces the values already present.
------------------------------------------------------------
--
/ Alexander Bokovoy