From 31d9529fe14bb21ff87c6e0030890fb32df15834 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Fri, 1 Nov 2019 14:56:52 +1300 Subject: [PATCH] disable task filtering for certain commands --- .zsh/zshrc/parts.d/50-taskwarrior | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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() { -- 2.39.5