mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Two new arguments for the help built-in command: topics and commands
ipa help topics will show all topics (equivalent to ipa help) ipa help commands will show list of all available commands
This commit is contained in:
parent
b83badd73b
commit
e46fd3401e
@ -475,16 +475,21 @@ class help(frontend.Command):
|
||||
super(help, self).finalize()
|
||||
|
||||
def run(self, key):
|
||||
if key is None:
|
||||
name = from_cli(key)
|
||||
if key is None or name == "topics":
|
||||
self.print_topics()
|
||||
return
|
||||
name = from_cli(key)
|
||||
if name in self._topics:
|
||||
self.print_commands(name)
|
||||
elif name in self.Command:
|
||||
cmd = self.Command[name]
|
||||
print 'Purpose: %s' % cmd.doc
|
||||
self.Backend.cli.build_parser(cmd).print_help()
|
||||
elif name == "commands":
|
||||
mcl = max(len(s) for s in (self.Command))
|
||||
for cname in self.Command:
|
||||
cmd = self.Command[cname]
|
||||
print '%s %s' % (to_cli(cmd.name).ljust(mcl), cmd.doc)
|
||||
else:
|
||||
raise HelpError(topic=name)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user