summaryrefslogtreecommitdiff
path: root/plugins/task/task.plugin.zsh
blob: 86b21b3cd01e9bfcf70d00ff966e5c54fb2227ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Autocompletion for the task CLI (task).
if (( !$+commands[task] )); then
  return
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `task`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_task" ]]; then
  typeset -g -A _comps
  autoload -Uz _task
  _comps[task]=_task
fi

# Generate and load task completion
task --completion zsh >! "$ZSH_CACHE_DIR/completions/_task" &|