charm.plugin.zsh 425 B

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