summaryrefslogtreecommitdiffstats
path: root/pykolab/cli
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-10-28 12:15:32 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-10-28 12:15:32 +0100
commit7e340bee4b2eb76610a886f73354718c73ffdc9e (patch)
tree670cffcff6c75b16736c73a866a1f4b68326e6c2 /pykolab/cli
parent7790ecb12466e2022061ca5cd0b0565975349681 (diff)
downloadpykolab-7e340bee4b2eb76610a886f73354718c73ffdc9e.tar.gz
Correct commands parsing
Diffstat (limited to 'pykolab/cli')
-rw-r--r--pykolab/cli/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pykolab/cli/__init__.py b/pykolab/cli/__init__.py
index 98075c9..a115271 100644
--- a/pykolab/cli/__init__.py
+++ b/pykolab/cli/__init__.py
@@ -48,10 +48,10 @@ class Cli(object):
to_execute = []
- arg_num = 1
+ arg_num = 0
for arg in sys.argv[1:]:
arg_num += 1
- if not arg.startswith('-') and len(sys.argv) > arg_num:
+ 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('-','_'))