diff options
| author | Aditya <bluenerd@protonmail.com> | 2023-02-27 20:04:56 +0530 | 
|---|---|---|
| committer | Aditya <bluenerd@protonmail.com> | 2023-02-27 20:04:56 +0530 | 
| commit | edc449275b6c04445f58b108ca0937a87c1e8430 (patch) | |
| tree | 9fd484d58145b616f29a78857cc0b1c8b1c18f05 /oh-my-zsh/plugins/sigstore/sigstore.plugin.zsh | |
| parent | 6f5424ca96c4221ef433f545642669e9c104d0ed (diff) | |
add zsh
Diffstat (limited to 'oh-my-zsh/plugins/sigstore/sigstore.plugin.zsh')
| -rw-r--r-- | oh-my-zsh/plugins/sigstore/sigstore.plugin.zsh | 22 | 
1 files changed, 22 insertions, 0 deletions
diff --git a/oh-my-zsh/plugins/sigstore/sigstore.plugin.zsh b/oh-my-zsh/plugins/sigstore/sigstore.plugin.zsh new file mode 100644 index 0000000..1f9d77c --- /dev/null +++ b/oh-my-zsh/plugins/sigstore/sigstore.plugin.zsh @@ -0,0 +1,22 @@ +function install_autocompletion { +  if (( ! $+commands[$1] )); then +    return +  fi + +  # If the completion file doesn't exist yet, we need to autoload it and +  # bind it to `$1` (cosign, sget, rekor-cli). Otherwise, compinit will +  # have already done that +  if [[ ! -f "$ZSH_CACHE_DIR/completions/_$1" ]]; then +    autoload -Uz _$1 +    typeset -g -A _comps +    _comps[$1]=_$1 +  fi + +  $1 completion zsh >| "$ZSH_CACHE_DIR/completions/_$1" &| +} + +install_autocompletion cosign +install_autocompletion sget +install_autocompletion rekor-cli + +unfunction install_autocompletion  | 
