pyenv/completions/rbenv.zsh
2011-09-07 10:26:11 -05:00

20 lines
436 B
Bash

#compdef _rbenv rbenv
function _rbenv_commands() {
cmds_str="$(rbenv commands)"
cmds=("${(ps:\n:)cmds_str}")
_describe '_rbenv_commands' cmds
}
_rbenv_versions() {
versions_str="$(rbenv versions --bare)"
versions=(system "${(ps:\n:)versions_str}")
_describe '_rbenv_versions' versions
}
_rbenv() {
case "$words[2]" in
set-* | global | local | shell | prefix ) _rbenv_versions ;;
* ) _rbenv_commands ;;
esac
}