2011-09-10 21:09:27 -04:00
|
|
|
compctl -K _rbenv rbenv
|
2011-08-16 00:39:38 -04:00
|
|
|
|
|
|
|
function _rbenv_commands() {
|
2011-09-10 21:13:42 -04:00
|
|
|
local cmds_str="$(rbenv commands)"
|
2011-09-10 21:09:27 -04:00
|
|
|
reply=("${(ps:\n:)cmds_str}")
|
2011-08-16 00:39:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
_rbenv_versions() {
|
2011-09-10 21:13:42 -04:00
|
|
|
local versions_str="$(rbenv versions --bare)"
|
2011-09-10 21:09:27 -04:00
|
|
|
reply=(system "${(ps:\n:)versions_str}")
|
2011-08-16 00:39:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
_rbenv() {
|
2011-09-10 21:09:27 -04:00
|
|
|
read -cA words
|
2011-08-16 00:39:38 -04:00
|
|
|
case "$words[2]" in
|
2011-09-07 11:26:11 -04:00
|
|
|
set-* | global | local | shell | prefix ) _rbenv_versions ;;
|
2011-08-16 00:39:38 -04:00
|
|
|
* ) _rbenv_commands ;;
|
|
|
|
esac
|
|
|
|
}
|