summaryrefslogtreecommitdiff
path: root/plugins/skaffold
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/skaffold')
-rw-r--r--plugins/skaffold/README.md9
-rw-r--r--plugins/skaffold/skaffold.plugin.zsh14
2 files changed, 23 insertions, 0 deletions
diff --git a/plugins/skaffold/README.md b/plugins/skaffold/README.md
new file mode 100644
index 000000000..4ee12c666
--- /dev/null
+++ b/plugins/skaffold/README.md
@@ -0,0 +1,9 @@
+# Skaffold plugin (Autocompletion)
+
+This plugin adds completion for [Skaffold](https://skaffold.dev)
+
+To use it, add `skaffold` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... skaffold)
+```
diff --git a/plugins/skaffold/skaffold.plugin.zsh b/plugins/skaffold/skaffold.plugin.zsh
new file mode 100644
index 000000000..8296c450c
--- /dev/null
+++ b/plugins/skaffold/skaffold.plugin.zsh
@@ -0,0 +1,14 @@
+# Autocompletion for skaffold
+if (( ! $+commands[skaffold] )); then
+ return
+fi
+
+# If the completion file doesn't exist yet, we need to autoload it and
+# bind it to `skaffold`. Otherwise, compinit will have already done that.
+if [[ ! -f "$ZSH_CACHE_DIR/completions/_skaffold" ]]; then
+ typeset -g -A _comps
+ autoload -Uz _skaffold
+ _comps[skaffold]=_skaffold
+fi
+
+skaffold completion zsh >| "$ZSH_CACHE_DIR/completions/_skaffold" &|