arduino-cli.plugin.zsh
472 bytes
1if (( ! $+commands[arduino-cli] )); then
2 return
3fi
4
5# If the completion file doesn't exist yet, we need to autoload it and
6# bind it to `arduino-cli`. Otherwise, compinit will have already done that.
7if [[ ! -f "$ZSH_CACHE_DIR/completions/_arduino-cli" ]]; then
8 typeset -g -A _comps
9 autoload -Uz _arduino-cli
10 _comps[arduino-cli]=_arduino-cli
11fi
12
13# Generate and load arduino-cli completion
14arduino-cli completion zsh >! "$ZSH_CACHE_DIR/completions/_arduino-cli" &|