From f974e33fa48908e7cb4f937b2a56cbc488b55004 Mon Sep 17 00:00:00 2001 From: "P.C. Shyamshankar" Date: Tue, 12 May 2009 18:58:27 +0800 Subject: [PATCH] Initial commit of zsh completion, completes only subcommands right now. Signed-off-by: Paul Beckingham --- completion/_task | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 completion/_task diff --git a/completion/_task b/completion/_task new file mode 100644 index 000000000..8344dad16 --- /dev/null +++ b/completion/_task @@ -0,0 +1,32 @@ +#compdef task +# zsh completion for task as of 1.6.0 +# P.C. Shyamshankar + +typeset -g _task_cmds +_task_cmds=(add append annotate completed description description delete undelete info start stop done undo projects tags summary history ghistory next calendar active overdue stats import export color version help list long ls newest oldest) + +_task() { + _arguments -s -S \ + "*::task command:_task_commands" + return 0 +} + + +(( $+functions[_task_commands] )) || +_task_commands() { + local cmd ret=1 + if (( CURRENT == 1 )); then + _describe -t commands 'task command' _task_cmds + else + local curcontext="${curcontext}" + cmd="${_task_cmds[(r)$words[1]:*]%%:*}" + if (( $#cmd )); then + curcontext="${curcontext%:*:*}:task-${cmd}" + _call_function ret _task_${cmd} || _message "No command remaining." + else + _message "Unknown subcommand ${cmd}" + fi + return ret + fi +} +