Commit 2d6925a0 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Properly pass arguments to default subcommand.

parent 23af7ce6
...@@ -166,7 +166,7 @@ class CLIApplication(object): ...@@ -166,7 +166,7 @@ class CLIApplication(object):
self.todolist = TodoList.TodoList(todofile.read()) self.todolist = TodoList.TodoList(todofile.read())
try: try:
subcommand = args.pop(0) subcommand = args[0]
except IndexError: except IndexError:
subcommand = self.config.default_command() subcommand = self.config.default_command()
...@@ -196,6 +196,8 @@ class CLIApplication(object): ...@@ -196,6 +196,8 @@ class CLIApplication(object):
if not subcommand in subcommand_map: if not subcommand in subcommand_map:
subcommand = self.config.default_command() subcommand = self.config.default_command()
else:
args.pop(0)
if self.execute(subcommand_map[subcommand], args) == False: if self.execute(subcommand_map[subcommand], args) == False:
exit(1) exit(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment