Parent directory

sigstore.plugin.zsh

571 bytes
 1function install_autocompletion {
 2  if (( ! $+commands[$1] )); then
 3    return
 4  fi
 5
 6  # If the completion file doesn't exist yet, we need to autoload it and
 7  # bind it to `$1` (cosign, sget, rekor-cli). Otherwise, compinit will
 8  # have already done that
 9  if [[ ! -f "$ZSH_CACHE_DIR/completions/_$1" ]]; then
10    autoload -Uz _$1
11    typeset -g -A _comps
12    _comps[$1]=_$1
13  fi
14
15  $1 completion zsh >| "$ZSH_CACHE_DIR/completions/_$1" &|
16}
17
18install_autocompletion cosign
19install_autocompletion sget
20install_autocompletion rekor-cli
21
22unfunction install_autocompletion