804731e83b69

Add option --done to list done tasks.
[view raw] [browse files]
author sealion <sealion@charadeyouare.org>
date Tue, 20 Sep 2011 11:52:30 +0400
parents 2f7fcbc59b02
children e8ad76b464c2
branches/tags (none)
files t.py

Changes

--- a/t.py	Mon May 09 21:22:15 2011 -0400
+++ b/t.py	Tue Sep 20 11:52:30 2011 +0400
@@ -255,6 +255,9 @@
     output.add_option("-q", "--quiet",
                       action="store_true", dest="quiet", default=False,
                       help="print less detailed output (no task ids, etc)")
+    output.add_option("--done",
+                      action="store_true", dest="done", default=False,
+                      help="list done tasks instead of unfinished ones")
     parser.add_option_group(output)
 
     return parser
@@ -277,7 +280,8 @@
             td.add_task(text)
             td.write(options.delete)
         else:
-            td.print_list(verbose=options.verbose, quiet=options.quiet,
+            kind = 'tasks' if not options.done else 'done'
+            td.print_list(kind=kind, verbose=options.verbose, quiet=options.quiet,
                           grep=options.grep)
     except AmbiguousPrefix, e:
         sys.stderr.write('The ID "%s" matches more than one task.' % e.prefix)