summaryrefslogtreecommitdiffstats
path: root/ipalib/cli.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-09-04 05:18:14 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-09-04 05:18:14 +0000
commitb16deabdffd19dcc6f85f3c1f03074484669912c (patch)
treec2ff890ecc64c4323209e2db798c3a614bd571ed /ipalib/cli.py
parentab81ca56fd336af4b83ef19a6f97dffe0b1a0923 (diff)
downloadfreeipa-b16deabdffd19dcc6f85f3c1f03074484669912c.tar.gz
freeipa-b16deabdffd19dcc6f85f3c1f03074484669912c.tar.xz
freeipa-b16deabdffd19dcc6f85f3c1f03074484669912c.zip
256: Fixed cli.help plugin so it looks up commands in CLI instead of API
Diffstat (limited to 'ipalib/cli.py')
-rw-r--r--ipalib/cli.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index e1cbfa78..5747fd04 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -45,20 +45,25 @@ def from_cli(cli_name):
class help(public.Application):
- 'Display help on command'
+ 'Display help on command.'
def __call__(self, key):
- if from_cli(key) not in self.api.Command:
+ key = str(key)
+ if key not in self.application:
print 'help: no such command %r' % key
sys.exit(2)
- print 'Help on command %r:' % key
+ cmd = self.application[key]
+ print 'Purpose: %s' % cmd.doc
+ if len(cmd.Option) > 0:
+ print '\nOptions:'
+ print ''
class console(public.Application):
- 'Start IPA Interactive Python Console'
+ 'Start the IPA Python console.'
def __call__(self):
code.interact(
- '(Custom IPA Interactive Python Console)',
+ '(Custom IPA interactive Python console)',
local=dict(api=self.api)
)