Commit 69715c07 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Handle the case when no todo number is given to 'dep dot'

parent 36ce7ef1
...@@ -135,10 +135,10 @@ class DepCommand(Command): ...@@ -135,10 +135,10 @@ class DepCommand(Command):
""" Handles the dot subsubcommand. """ """ Handles the dot subsubcommand. """
self.printer = DotPrinter(self.todolist) self.printer = DotPrinter(self.todolist)
arg = self.argument(1)
try: try:
arg = self.argument(1)
todo = self.todolist.todo(arg) todo = self.todolist.todo(arg)
arg = self.argument(1)
todos = set([self.todolist.todo(arg)]) todos = set([self.todolist.todo(arg)])
todos |= set(self.todolist.children(todo)) todos |= set(self.todolist.children(todo))
todos |= set(self.todolist.parents(todo)) todos |= set(self.todolist.parents(todo))
...@@ -147,6 +147,8 @@ class DepCommand(Command): ...@@ -147,6 +147,8 @@ class DepCommand(Command):
self.out(self.printer.print_list(todos)) self.out(self.printer.print_list(todos))
except InvalidTodoException: except InvalidTodoException:
self.error("Invalid todo number given.") self.error("Invalid todo number given.")
except InvalidCommandArgument:
self.error(self.usage())
def execute(self): def execute(self):
......
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