task: Ensure compdef options only get set in zsh

This commit is contained in:
Marty Oehme 2025-06-22 18:31:00 +02:00
parent ededd904b4
commit 21844e3a30
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -14,7 +14,9 @@ t() {
# copy the `task` zsh completions over to my little alias 😉
# FIXME: this is not very pretty and not super portable (needs ps) but
# works for now. from here: https://unix.stackexchange.com/a/72564/414758
if exist task && [ "$(ps -p $$ -o comm --no-headers)" = "zsh" ]; then compdef t=task; fi
if echo "$SHELL" | grep -q zsh; then
if exist task && [ "$(ps -p $$ -o comm --no-headers)" = "zsh" ]; then compdef t=task; fi
fi
alias ta="task add"
alias tal="task log"
@ -29,8 +31,8 @@ if exist timew; then
else
alias tra="task active"
fi
alias tdd="task end.after:today all" # done doday
alias tdy="task end.after:yesterday all" # done yesterday-today
alias tdd="task end.after:today all" # done doday
alias tdy="task end.after:yesterday all" # done yesterday-today
alias tdw="task end.after:today-1wk completed" # done this week
alias tad="task +ACTIVE done"