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:
13
completions/_rbenv
Normal file
13
completions/_rbenv
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user