pyenv/completions/rbenv.bash

30 lines
590 B
Bash
Raw Normal View History

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