From f1ca8906c0f38940dbe7b162cedacd6b76d75735 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Tue, 13 Sep 2011 12:38:34 -0500 Subject: [PATCH] Completions for global, local, prefix, shell --- libexec/rbenv-global | 6 ++++++ libexec/rbenv-local | 1 - libexec/rbenv-prefix | 6 ++++++ libexec/rbenv-sh-shell | 6 ++++++ 4 files changed, 18 insertions(+), 1 deletion(-) 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