pyenv/completions/rbenv.bash

30 lines
577 B
Bash
Raw Normal View History

2011-08-04 02:43:40 +00:00
_rbenv_commands() {
2011-08-04 01:44:29 +00:00
COMPREPLY=()
2011-08-04 03:20:25 +00:00
local cur="${COMP_WORDS[COMP_CWORD]}"
COMPREPLY=( $( compgen -W "$(rbenv commands)" -- $cur ) )
}
2011-08-04 02:43:40 +00:00
_rbenv_versions() {
2011-08-04 01:44:29 +00:00
COMPREPLY=()
2011-08-04 03:22:45 +00:00
local cur="${COMP_WORDS[COMP_CWORD]}"
local versions="$(echo system; rbenv versions --bare)"
2011-08-04 02:43:40 +00:00
COMPREPLY=( $( compgen -W "$versions" -- $cur ) )
}
2011-08-04 01:44:29 +00:00
_rbenv() {
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"
case "$prev" in
default | local | prefix )
2011-08-04 02:43:40 +00:00
_rbenv_versions
;;
* )
2011-08-04 02:43:40 +00:00
_rbenv_commands
;;
esac
}
complete -F _rbenv rbenv