Commit 50aa61ac authored by Bram Schoenmakers's avatar Bram Schoenmakers

Add support for flag to show an unfiltered list.

parent 04638cb0
......@@ -16,5 +16,15 @@ class Command(object):
return value
def argumentShift(self, p_expr):
"""
Returns true when the first argument equals the given expression.
"""
if len(self.args) and self.argument(0) == p_expr:
del self.args[0]
return True
return False
def usage(self):
return ""
......@@ -8,9 +8,11 @@ class ListCommand(Command.Command):
super(ListCommand, self).__init__(p_args, p_todolist)
def execute(self):
showAll = self.argumentShift("-x")
sorter = Sorter.Sorter(Config.SORT_STRING)
filters = [Filter.DependencyFilter(self.todolist),
Filter.RelevanceFilter()]
filters = [] if showAll else \
[Filter.DependencyFilter(self.todolist), Filter.RelevanceFilter()]
if len(self.args) > 0:
filters.append(Filter.GrepFilter(self.argument(0)))
......
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