mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-18 14:52:59 -05:00
29 lines
592 B
Bash
29 lines
592 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() {
|
|
COMPREPLY=()
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
local prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
case "$prev" in
|
|
set-* | global | local | shell | prefix )
|
|
_rbenv_versions
|
|
;;
|
|
* )
|
|
_rbenv_commands
|
|
;;
|
|
esac
|
|
}
|
|
|
|
complete -F _rbenv rbenv
|