diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-09-04 21:11:59 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-09-04 21:11:59 +0200 |
commit | b0736af7f9c79076addaec2f621f2aa9b2a02eb7 (patch) | |
tree | 82aa580d6f862cf802f1aef39ed6ea4d2506e52a | |
parent | 7936aa6b46090035cb6e6cc23b22e685ac8340c3 (diff) |
Added semi-finished devtodo completion
-rw-r--r-- | etc/completions/_devtodo | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/etc/completions/_devtodo b/etc/completions/_devtodo new file mode 100644 index 0000000..9015acf --- /dev/null +++ b/etc/completions/_devtodo @@ -0,0 +1,55 @@ +#compdef devtodo todo tda tde tdd tdr +## completion for devtodo 0.1.20 +## Daniel Friesel <derf@derf.homelinux.org> +## https://derf.homelinux.org/~derf/dotfiles/completion/_devtodo + +typeset -a arg_generic arg_add +typeset -A arg_pair arg_desc + +arg_add=( + '-p[priority]:priority:_priority' + '-g[parent item]:parent:_index' +) + +arg_generic=( + '--remove[remove items]:index:_index' + '--database[database file]:file:_files' + '--global-database[global database file]:file:_files' + '*--colour[item color]:color:_color' + '--force-colour[force use of colors]' + '--mono[no colors]' + '--help[display help]' + '--version[display version]' + '--title[todo title]:string: ' + '--date-format[strftime time formet]:time string: ' + '*--format[define format]:format:_format' + '*--use-format[output format]:format:_format' + '--sort[sort database]:expression: ' + '--paranoid[paranoid parmissions etc]' + '--database-loaders[loader order]:database loader: ' + '--backup[backup database]:count: ' + '--timeout[display timeout]:seconds: ' + '--purge[purge completed items]:days: ' +) + +function _index () { + typeset i + typeset -a index desc + for i in $(todo --format display='%n '); do + index+=${i}:$(todo --format display='%t' $i) + done + _describe index index +} + +function _color () { +} + +function _format () { +} + +case $service in + tda) _arguments -s $arg_add ;; + tde|tdd) _arguments -s ':index:_index' ;; + tdr) _arguments -s '*:index:_index' ;; + *todo) _arguments -s $arg_generic ;; +esac |