about summary refs log tree commit diff
path: root/Completion/Zsh
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-11-22 19:17:32 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-11-22 19:17:32 +0000
commitb7e76da2ef8e25fde84ad0c235c2bc560ea03863 (patch)
treeb2c3b2e78ee72ada9745b6e733f79f75d9e1ba84 /Completion/Zsh
parent3d8115275f6a5032d37178bd01fa8ce1b726b353 (diff)
downloadzsh-b7e76da2ef8e25fde84ad0c235c2bc560ea03863.tar.gz
zsh-b7e76da2ef8e25fde84ad0c235c2bc560ea03863.tar.xz
zsh-b7e76da2ef8e25fde84ad0c235c2bc560ea03863.zip
Alexey: users/14588: ztodo function and completion
Diffstat (limited to 'Completion/Zsh')
-rw-r--r--Completion/Zsh/Command/_ztodo30
1 files changed, 30 insertions, 0 deletions
diff --git a/Completion/Zsh/Command/_ztodo b/Completion/Zsh/Command/_ztodo
new file mode 100644
index 000000000..73be91e0c
--- /dev/null
+++ b/Completion/Zsh/Command/_ztodo
@@ -0,0 +1,30 @@
+#compdef ztodo
+
+_ztodo_entries() {
+  local -a entries
+
+  entries=(${${${${(f)"$(_call_program ztodo-entry ztodo list)"}#[[:space:]]##}/:[[:space:]]##/:}%:[[:space:]]#})
+  _describe -t ztodo-entry 'todo entry' entries "$@"
+}
+
+local -a args reply
+args=(
+  /$'[^\0]#\0'/
+)
+
+local -a todo_entry
+todo_entry=(
+  /$'[^\0]#\0'/ ':ztodo-entry:todo entry:_ztodo_entries'
+)
+
+_regex_words \
+  commands "ztodo command" \
+  'add:add entry' \
+  'del:delete entry:$todo_entry' \
+  'clear:clear todo list' \
+  'list:show todo list'
+args+=("$reply[@]")
+
+_regex_arguments _ztodo "${args[@]}"
+
+_ztodo "$@"