1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-18 08:13:46 -05:00

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>
This commit is contained in:
Farid NL
2024-05-03 08:57:16 -06:00
committed by GitHub
parent ac020225c2
commit a3b98a4223
4 changed files with 53 additions and 21 deletions

13
completions/_rbenv Normal file
View File

@@ -0,0 +1,13 @@
#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
}