Fix zsh autocompletion. Closes #47.

This commit is contained in:
Sam Stephenson 2011-09-10 20:09:27 -05:00
parent fb6eee26d4
commit ed9f69fe23

View file

@ -1,18 +1,17 @@
#compdef _rbenv rbenv compctl -K _rbenv rbenv
function _rbenv_commands() { function _rbenv_commands() {
cmds_str="$(rbenv commands)" cmds_str="$(rbenv commands)"
cmds=("${(ps:\n:)cmds_str}") reply=("${(ps:\n:)cmds_str}")
_describe '_rbenv_commands' cmds
} }
_rbenv_versions() { _rbenv_versions() {
versions_str="$(rbenv versions --bare)" versions_str="$(rbenv versions --bare)"
versions=(system "${(ps:\n:)versions_str}") reply=(system "${(ps:\n:)versions_str}")
_describe '_rbenv_versions' versions
} }
_rbenv() { _rbenv() {
read -cA words
case "$words[2]" in case "$words[2]" in
set-* | global | local | shell | prefix ) _rbenv_versions ;; set-* | global | local | shell | prefix ) _rbenv_versions ;;
* ) _rbenv_commands ;; * ) _rbenv_commands ;;