summaryrefslogtreecommitdiff
path: root/plugins/doctl/doctl.plugin.zsh
diff options
context:
space:
mode:
authorAndrew Starr-Bochicchio <andrewsomething@users.noreply.github.com>2022-12-20 14:56:30 -0500
committerGitHub <noreply@github.com>2022-12-20 19:56:30 +0000
commit9c2d1af8afa02b5439e8ccc81a160e62e1e59617 (patch)
tree16dcab3e183b02958e2f493cc446f73815dedfc1 /plugins/doctl/doctl.plugin.zsh
parent2bc42d223cfe3e21aef06648fb971bd9fb00828e (diff)
downloadzsh-9c2d1af8afa02b5439e8ccc81a160e62e1e59617.tar.gz
zsh-9c2d1af8afa02b5439e8ccc81a160e62e1e59617.tar.bz2
zsh-9c2d1af8afa02b5439e8ccc81a160e62e1e59617.zip
fix(doctl): actually load completions (#11402)
Diffstat (limited to 'plugins/doctl/doctl.plugin.zsh')
-rw-r--r--plugins/doctl/doctl.plugin.zsh12
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/doctl/doctl.plugin.zsh b/plugins/doctl/doctl.plugin.zsh
index d23ed085c..7b3a384a9 100644
--- a/plugins/doctl/doctl.plugin.zsh
+++ b/plugins/doctl/doctl.plugin.zsh
@@ -4,6 +4,14 @@
#
# Author: https://github.com/HalisCz
-if [ $commands[doctl] ]; then
- source <(doctl completion zsh)
+if (( ! $+commands[doctl] )); then
+ return
fi
+
+if [[ ! -f "$ZSH_CACHE_DIR/completions/_doctl" ]]; then
+ typeset -g -A _comps
+ autoload -Uz _doctl
+ _comps[doctl]=_doctl
+fi
+
+doctl completion zsh >| "$ZSH_CACHE_DIR/completions/_doctl" &|