mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
feat(kubeadm): add auto-completion plugin
This commit is contained in:
parent
7dcabbe682
commit
f3b9cf3bea
2 changed files with 21 additions and 0 deletions
10
plugins/kubeadm/README.md
Normal file
10
plugins/kubeadm/README.md
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# kubeadm plugin
|
||||||
|
|
||||||
|
This plugin adds completion for the [kubernetes cluster creator](https://kubernetes.io/docs/reference/setup-tools/kubeadm/).
|
||||||
|
Kubeadm is a tool built to provide kubeadm init and kubeadm join as best-practice "fast paths" for creating Kubernetes clusters.
|
||||||
|
|
||||||
|
To use it, add `kubeadm` to the plugins array in your zshrc file:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
plugins=(... kubeadm)
|
||||||
|
```
|
11
plugins/kubeadm/kubeadm.plugin.zsh
Normal file
11
plugins/kubeadm/kubeadm.plugin.zsh
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
if (( $+commands[kubeadm] )); then
|
||||||
|
# If the completion file does not exist, generate it and then source it
|
||||||
|
# Otherwise, source it and regenerate in the background
|
||||||
|
if [[ ! -f "$ZSH_CACHE_DIR/completions/_kubeadm" ]]; then
|
||||||
|
kubeadm completion zsh | tee "$ZSH_CACHE_DIR/completions/_kubeadm" >/dev/null
|
||||||
|
source "$ZSH_CACHE_DIR/completions/_kubeadm"
|
||||||
|
else
|
||||||
|
source "$ZSH_CACHE_DIR/completions/_kubeadm"
|
||||||
|
kubeadm completion zsh | tee "$ZSH_CACHE_DIR/completions/_kubeadm" >/dev/null &|
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
Reference in a new issue