Commit bd9e298e authored by Bram Schoenmakers's avatar Bram Schoenmakers

When list command receives arguments, treat them as an unfiltered grep.

parent 1c54ac7b
......@@ -11,13 +11,12 @@ class ListCommand(Command.Command):
super(ListCommand, self).__init__(p_args, p_todolist, p_out, p_err, p_prompt)
def execute(self):
showAll = self.argumentShift("-x")
sorter = Sorter.Sorter(Config.SORT_STRING)
filters = [] if showAll else \
[Filter.DependencyFilter(self.todolist), Filter.RelevanceFilter()]
filters = []
if len(self.args) > 0:
filters.append(Filter.GrepFilter(self.argument(0)))
filters = [Filter.GrepFilter(self.argument(0))]
else:
filters = [Filter.DependencyFilter(self.todolist), Filter.RelevanceFilter()]
self.out(self.todolist.view(sorter, filters).pretty_print())
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