From ee5ad02d42690f572d4a89386e84e6b3c04df054 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Sun, 25 Dec 2011 20:59:24 -0500 Subject: [PATCH] Add --no-rehash option to rbenv-init (#170) --- libexec/rbenv-init | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libexec/rbenv-init b/libexec/rbenv-init index 73aeadf1..ed440d13 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -8,6 +8,12 @@ if [ "$1" = "-" ]; then shift fi +no_rehash="" +if [ "$1" = "--no-rehash" ]; then + no_rehash=1 + shift +fi + shell="$1" if [ -z "$shell" ]; then shell="$(basename "$SHELL")" @@ -69,7 +75,9 @@ bash | zsh ) ;; esac -echo 'rbenv rehash 2>/dev/null' +if [ -z "$no_rehash" ]; then + echo 'rbenv rehash 2>/dev/null' +fi commands=(`rbenv commands --sh`) IFS="|"