From 6f3304f442afde6e1cf3e7e8641a405d29d2e73d Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 4 Mar 2023 09:25:01 +0100 Subject: feat(argocd): add completion plugin Co-authored-by: Sumudu Lansakara Closes #9900 --- plugins/argocd/gh.plugin.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 plugins/argocd/gh.plugin.zsh (limited to 'plugins/argocd/gh.plugin.zsh') diff --git a/plugins/argocd/gh.plugin.zsh b/plugins/argocd/gh.plugin.zsh new file mode 100644 index 000000000..8de7b0238 --- /dev/null +++ b/plugins/argocd/gh.plugin.zsh @@ -0,0 +1,14 @@ +# Autocompletion for argocd. +if (( ! $+commands[argocd] )); then + return +fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `argocd`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_argocd" ]]; then + typeset -g -A _comps + autoload -Uz _argocd + _comps[argocd]=_argocd +fi + +argocd completion zsh >| "$ZSH_CACHE_DIR/completions/_argocd" &| -- cgit v1.2.3-70-g09d2