diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-11-10 16:26:03 +0000 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-11-10 16:26:03 +0000 |
commit | 80af0d0ca6be1b2a4c6547a92c521cc2a69fe66d (patch) | |
tree | 71a09e9908a065be2e2620027f82b63d3804d1f5 /pykolab | |
parent | 84071b889670c1aa09360c4edd60572136fa69c3 (diff) | |
download | pykolab-80af0d0ca6be1b2a4c6547a92c521cc2a69fe66d.tar.gz |
Display help if an unknown command is specified (and do not bail out on --help).
Fix typo
Diffstat (limited to 'pykolab')
-rw-r--r-- | pykolab/cli/commands.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pykolab/cli/commands.py b/pykolab/cli/commands.py index 7376234..d2f6d82 100644 --- a/pykolab/cli/commands.py +++ b/pykolab/cli/commands.py @@ -108,6 +108,10 @@ def list_commands(*args, **kw): print "%-4s%-21s" % ('',__command.replace('_','-')) def execute(cmd_name, *args, **kw): + if cmd_name == "": + execute("help") + sys.exit(0) + if not commands.has_key(cmd_name): log.error(_("No such command.")) sys.exit(1) @@ -190,7 +194,7 @@ def register(cmd_name, func, group=None, description=None, aliases=[]): commands[alias] = { 'cmd_name': cmd_name, 'function': func, - 'description': _("Alias for %s") % (cmd_name,replace('_','-')) + 'description': _("Alias for %s") % (cmd_name.replace('_','-')) } ## |