mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Rename helpers
This commit is contained in:
parent
4e79ba15f7
commit
f7c463bed9
1 changed files with 8 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
||||||
_commands() {
|
_rbenv_commands() {
|
||||||
local cur commands
|
local cur commands
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
@ -8,16 +8,16 @@ _commands() {
|
||||||
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
|
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
_rubies() {
|
_rbenv_versions() {
|
||||||
local cur rubies
|
local cur versions
|
||||||
local ROOT="${HOME}/.rbenv/versions"
|
local ROOT="${HOME}/.rbenv/versions"
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur=${COMP_WORDS[COMP_CWORD]}
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
rubies=($ROOT/*)
|
versions=($ROOT/*)
|
||||||
# remove all but the final part of the name
|
# remove all but the final part of the name
|
||||||
rubies="${rubies[@]##*/}"
|
versions="${versions[@]##*/}"
|
||||||
|
|
||||||
COMPREPLY=( $( compgen -W "$rubies" -- $cur ) )
|
COMPREPLY=( $( compgen -W "$versions" -- $cur ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
_rbenv() {
|
_rbenv() {
|
||||||
|
@ -27,9 +27,9 @@ _rbenv() {
|
||||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
if [ "$prev" = "set-default" ]; then
|
if [ "$prev" = "set-default" ]; then
|
||||||
_rubies
|
_rbenv_versions
|
||||||
else
|
else
|
||||||
_commands
|
_rbenv_commands
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue