summaryrefslogtreecommitdiffstats
path: root/pykolab/cli/__init__.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-11-10 17:02:40 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-11-10 17:02:40 +0000
commit0d49633f453164fffc03fd62460b1b39a7cfe5a4 (patch)
tree66843f8c8fa101113ac30a0483f2fc3a777d2437 /pykolab/cli/__init__.py
parent80af0d0ca6be1b2a4c6547a92c521cc2a69fe66d (diff)
downloadpykolab-0d49633f453164fffc03fd62460b1b39a7cfe5a4.tar.gz
Allow a grouped command to be executed like so:
$ kolab sieve list
Diffstat (limited to 'pykolab/cli/__init__.py')
-rw-r--r--pykolab/cli/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/pykolab/cli/__init__.py b/pykolab/cli/__init__.py
index a51a3aa..5860fd9 100644
--- a/pykolab/cli/__init__.py
+++ b/pykolab/cli/__init__.py
@@ -51,6 +51,12 @@ class Cli(object):
if not arg.startswith('-') and len(sys.argv) >= arg_num:
if commands.commands.has_key(sys.argv[arg_num].replace('-','_')):
to_execute.append(sys.argv[arg_num].replace('-','_'))
+
+ if commands.commands.has_key("%s_%s" % (
+ '_'.join(to_execute),sys.argv[arg_num].replace('-','_')
+ )):
+
+ to_execute.append(sys.argv[arg_num].replace('-','_'))
commands.execute('_'.join(to_execute))