fluxcd.plugin.zsh 417 B

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