Commit ca323e67 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Print usage when no arguments were given.

parent 8bd6f1d2
......@@ -66,8 +66,11 @@ class AddCommand(Command.Command):
def execute(self):
""" Adds a todo item to the list. """
self._preprocess_input_todo()
self.todo = self.todolist.add(self.text)
self._postprocess_input_todo()
self.out(pretty_print(self.todo, [self.todolist.pp_number()]))
if self.text:
self._preprocess_input_todo()
self.todo = self.todolist.add(self.text)
self._postprocess_input_todo()
self.out(pretty_print(self.todo, [self.todolist.pp_number()]))
else:
self.error(self.usage())
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