X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/50170249933c1fefb395c254505affe6b3e8a591..8078ceed9b50dad2d319a74e2d3014b6ff649b47:/.zsh/zshrc/parts.d/50-taskwarrior?ds=inline 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() {