summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-10-18 13:32:36 -0400
committerRob Crittenden <rcritten@redhat.com>2011-10-20 18:25:51 -0400
commit7bde6a7da90dfc5f8953736f27cf9e17e82d14f2 (patch)
treee52aac34351205b7f454e1aa3afaf38f95d3a42d
parent9b7639a89df70bdd5cbc29c0393ebe53395e566f (diff)
downloadfreeipa-7bde6a7da90dfc5f8953736f27cf9e17e82d14f2.tar.gz
freeipa-7bde6a7da90dfc5f8953736f27cf9e17e82d14f2.tar.xz
freeipa-7bde6a7da90dfc5f8953736f27cf9e17e82d14f2.zip
Fix problems in help systemipa-2-1
Fixes 3 issues: - If a topic has all its commands disabled, it should be disabled - If a command is disabled its help should be disabled - The show-mappings help was missing a doc string so no help was displayed https://fedorahosted.org/freeipa/ticket/1998
-rw-r--r--ipalib/cli.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 06e7b1c47..7fe808755 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -748,6 +748,8 @@ class help(frontend.Local):
self.print_commands(name)
elif name in self.Command:
cmd = self.Command[name]
+ if cmd.NO_CLI:
+ raise HelpError(topic=name)
print unicode(_('Purpose: %s')) % unicode(_(cmd.doc)).strip()
self.Backend.cli.build_parser(cmd).print_help()
elif mod_name in sys.modules:
@@ -805,6 +807,9 @@ class help(frontend.Local):
m = '%s.%s' % (self._PLUGIN_BASE_MODULE, topic)
doc = (unicode(_(sys.modules[m].__doc__)) or '').strip()
+ if topic not in self.Command and len(commands) == 0:
+ raise HelpError(topic=topic)
+
print doc
if len(commands) > 1:
print ''
@@ -814,6 +819,9 @@ class help(frontend.Local):
print "\n"
class show_mappings(frontend.Command):
+ """
+ Show mapping of LDAP attributes to command-line option.
+ """
takes_args = (
Str('command_name',
label=_('Command name'),