commit 8d3800ab7030dee84508bbe5243f03d09aa63268
Author: Simon Guinot <simon@sequanux.org>
Date:   Wed Nov 12 00:00:57 2008 +0100

    Add status and orderBy arguments to the t_list command.
    Add the t_list_done and t_list_current wrappers for the t_list command.

diff --git a/taskcmd.py b/taskcmd.py
index 3355614..da93ee5 100644
--- a/taskcmd.py
+++ b/taskcmd.py
@@ -113,7 +113,7 @@ class TaskCmd(object):
         if len(taskList) == 0:
             project.delete(project.id)
 
-    def do_t_list(self, line):
+    def do_t_list(self, line, status=["new", "started", "done"], orderBy=-Task.q.creationDate):
         """List tasks by project and/or keywords.
         t_list <project_name> [<keyword1> [<keyword2>]...]
 
@@ -134,9 +134,9 @@ class TaskCmd(object):
             keywordSet = None
 
         for project in projectList:
-            taskList = Task.select(AND(Task.q.projectID == project.id,
-                                       Task.q.status    != 'done'),
-                                   orderBy=-Task.q.urgency)
+            taskList = Task.select(AND(Task.q.projectID == project.id, 
+                                       IN(Task.q.status, status)),
+                                   orderBy=orderBy)
 
             if keywordSet:
                 # FIXME: Optimize
@@ -153,6 +153,26 @@ class TaskCmd(object):
 
     complete_t_list = ProjectCompleter(1)
 
+    def do_t_list_done(self, line):
+        """List tasks marked done by project and/or keywords.
+        t_list_done <project_name> [<keyword1> [<keyword2>]...]
+
+        '%' can be used as a wildcard in the project name:
+        - To list projects starting with "foo", use "foo%".
+        - To list all projects, use "%".
+        """
+        self.do_t_list(line, status=["done"], orderBy=-Task.q.doneDate)
+
+    def do_t_list_current(self, line):
+        """List current tasks by project and/or keywords.
+        t_list_current <project_name> [<keyword1> [<keyword2>]...]
+
+        '%' can be used as a wildcard in the project name:
+        - To list projects starting with "foo", use "foo%".
+        - To list all projects, use "%".
+        """
+        self.do_t_list(line, status=["new", "started"], orderBy=-Task.q.urgency)
+
     def do_t_reorder(self, line):
         """Reorder tasks of a project.
         It works by starting an editor with the task list: you can then change

