X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/b0bfec58309c4b6f9447230e4c3f4d89ce18affa..31d9529fe14bb21ff87c6e0030890fb32df15834:/.zsh/zshrc/parts.d/50-taskwarrior diff --git a/.zsh/zshrc/parts.d/50-taskwarrior b/.zsh/zshrc/parts.d/50-taskwarrior index 665f854..2ca20b9 100644 --- a/.zsh/zshrc/parts.d/50-taskwarrior +++ b/.zsh/zshrc/parts.d/50-taskwarrior @@ -10,17 +10,21 @@ if whence task >/dev/null; then function task_() { - local spec cmd args nospec=0 + local filter cmd args nofilter=0 cmd="$1"; shift - [[ "$cmd" = add ]] && nospec=1 + + case "$cmd" in + (add|attach|call) nofilter=1;; + esac + for i in "$@"; do - case "$nospec@$i" in + case "$nofilter@$i" in (0@<->) :;& - (0@/*/) spec="${spec:+$spec }$i";; + (0@/*/) filter="${filter:+$filter }$i";; (*) args="${args:+$args }$i";; esac done - eval task $spec $cmd $args + eval task $filter $cmd $args } function task_postpone() {