Skip to content

Commit

Permalink
Print empty output of dep ls
Browse files Browse the repository at this point in the history
Lack of printing empty result was especially confusing in column UI
(console wasn't opened and user could think that command wasn't
executed).
  • Loading branch information
mruwek committed Feb 20, 2017
1 parent 77abb6c commit 67975f4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions topydo/commands/DepCommand.py
Expand Up @@ -119,13 +119,12 @@ def _handle_ls(self):
todo = self.todolist.todo(number)
todos = self.todolist.parents(todo)
else:
self.error(self.usage())
raise InvalidCommandArgument

if todos:
sorter = Sorter(config().sort_string())
instance_filter = Filter.InstanceFilter(todos)
view = View(sorter, [instance_filter], self.todolist)
self.out(self.printer.print_list(view.todos))
sorter = Sorter(config().sort_string())
instance_filter = Filter.InstanceFilter(todos)
view = View(sorter, [instance_filter], self.todolist)
self.out(self.printer.print_list(view.todos))
except InvalidTodoException:
self.error("Invalid todo number given.")
except InvalidCommandArgument:
Expand Down

0 comments on commit 67975f4

Please sign in to comment.