rbenv/completions/_rbenv
Farid NL a3b98a4223
Use compsys completion system for zsh (#1569)
The new `_rbenv` script will be autoloaded by zsh as long as it's found in $FPATH.
It should be the package manager's responsibility to symlink or move this file
into an appropriate location.

Co-authored-by: Mislav Marohnić <git@mislav.net>
2024-05-03 16:57:16 +02:00

13 lines
305 B
Text

#compdef rbenv
_rbenv() {
local completions
if [ "${#words}" -eq 2 ]; then
completions=(${(f)"$(rbenv help --complete-commands "${words[2]}")"})
_describe 'rbenv commands' completions
else
completions="$(rbenv completions ${words[2,-2]})"
compadd - "${(ps:\n:)completions}"
fi
}