kind.plugin.zsh 679 B

1234567891011121314151617181920212223
  1. if (( ! $+commands[kind] )); then
  2. return
  3. fi
  4. # If the completion file doesn't exist yet, we need to autoload it and
  5. # bind it to `kind`. Otherwise, compinit will have already done that.
  6. if [[ ! -f "$ZSH_CACHE_DIR/completions/_kind" ]]; then
  7. typeset -g -A _comps
  8. autoload -Uz _kind
  9. _comps[kind]=_kind
  10. fi
  11. # Generate and load kind completion
  12. kind completion zsh >! "$ZSH_CACHE_DIR/completions/_kind" &|
  13. # Register aliases
  14. alias kicc="kind create cluster"
  15. alias kiccn="kind create cluster --name"
  16. alias kigc="kind get clusters"
  17. alias kidc="kind delete cluster"
  18. alias kidcn="kind delete cluster --name"
  19. alias kidca="kind delete clusters -A"
  20. alias kigk="kind get kubeconfig"