about summary refs log tree commit diff
path: root/Completion/Unix/Command/_todo.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command/_todo.sh')
-rw-r--r--Completion/Unix/Command/_todo.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_todo.sh b/Completion/Unix/Command/_todo.sh
index 583aa008c..5d60b9684 100644
--- a/Completion/Unix/Command/_todo.sh
+++ b/Completion/Unix/Command/_todo.sh
@@ -57,7 +57,13 @@ case $state in
     ;;
 
     (list|listall)
-    _message search term...
+    # This completes stuff beginning with p: (projects) or @ (contexts);
+    # these are todo.sh conventions.
+    # We should do it for any argument after list or listall, but
+    # _arguments doesn't make that easy.  We need it to tell us
+    # the position of the first non-option argument.
+    _wanted search expl 'context or project' \
+      compadd ${${=${${(M)${(f)"$(todo.sh list)"}##<-> *}##<-> }}:#^(p:*|@*)}
     ;;
 
     (listpri)