1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-16 15:23:53 -05:00
Files
pyenv/completions/rbenv.bash
2011-08-03 22:22:45 -05:00

28 lines
559 B
Bash

_rbenv_commands() {
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
COMPREPLY=( $( compgen -W "$(rbenv commands)" -- $cur ) )
}
_rbenv_versions() {
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
local versions="$(echo system; rbenv versions --bare)"
COMPREPLY=( $( compgen -W "$versions" -- $cur ) )
}
_rbenv() {
local cur prev
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
if [ "$prev" = "set-default" ]; then
_rbenv_versions
else
_rbenv_commands
fi
}
complete -F _rbenv rbenv