diff --git a/libexec/rbenv-global b/libexec/rbenv-global index 4bffa7cf..0c239fd1 100755 --- a/libexec/rbenv-global +++ b/libexec/rbenv-global @@ -2,6 +2,12 @@ set -e [ -n "$RBENV_DEBUG" ] && set -x +# Provide rbenv completions +if [ "$1" = "--complete" ]; then + echo system + exec rbenv-versions --bare +fi + RBENV_VERSION="$1" RBENV_VERSION_FILE="${RBENV_ROOT}/global" diff --git a/libexec/rbenv-local b/libexec/rbenv-local index b9312fd1..5e154069 100755 --- a/libexec/rbenv-local +++ b/libexec/rbenv-local @@ -4,7 +4,6 @@ set -e # Provide rbenv completions if [ "$1" = "--complete" ]; then - shift echo system --unset exec rbenv-versions --bare fi diff --git a/libexec/rbenv-prefix b/libexec/rbenv-prefix index 9aeacc09..e6094aec 100755 --- a/libexec/rbenv-prefix +++ b/libexec/rbenv-prefix @@ -2,6 +2,12 @@ set -e [ -n "$RBENV_DEBUG" ] && set -x +# Provide rbenv completions +if [ "$1" = "--complete" ]; then + echo system + exec rbenv-versions --bare +fi + if [ -n "$1" ]; then export RBENV_VERSION="$1" elif [ -z "$RBENV_VERSION" ]; then diff --git a/libexec/rbenv-sh-shell b/libexec/rbenv-sh-shell index dde85e11..674a9267 100755 --- a/libexec/rbenv-sh-shell +++ b/libexec/rbenv-sh-shell @@ -2,6 +2,12 @@ set -e [ -n "$RBENV_DEBUG" ] && set -x +# Provide rbenv completions +if [ "$1" = "--complete" ]; then + echo system --unset + exec rbenv-versions --bare +fi + version="$1" if [ -z "$version" ]; then