Skip to content

Commit de1ca65

Browse files
feat(procs): support completion for procs<0.14 (ohmyzsh#13053)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
1 parent 92bad89 commit de1ca65

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

plugins/procs/procs.plugin.zsh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ if (( ! $+commands[procs] )); then
33
fi
44

55
# If the completion file doesn't exist yet, we need to autoload it and
6-
# bind it to `minikube`. Otherwise, compinit will have already done that.
6+
# bind it to `procs`. Otherwise, compinit will have already done that.
77
if [[ ! -f "$ZSH_CACHE_DIR/completions/_procs" ]]; then
88
typeset -g -A _comps
99
autoload -Uz _procs
1010
_comps[procs]=_procs
1111
fi
1212

13-
procs --gen-completion-out zsh >| "$ZSH_CACHE_DIR/completions/_procs" &|
13+
{
14+
autoload -Uz is-at-least
15+
local _version=$(procs --version)
16+
if is-at-least "0.14" "${_version#procs }"; then
17+
procs --gen-completion-out zsh >| "$ZSH_CACHE_DIR/completions/_procs"
18+
else
19+
procs --completion-out zsh >| "$ZSH_CACHE_DIR/completions/_procs"
20+
fi
21+
} &|

0 commit comments

Comments
 (0)