From f40bc773d231acfcf83a3c9b71eba67ed1cc4bef Mon Sep 17 00:00:00 2001 From: John Williams Date: Tue, 17 Jan 2012 08:50:40 -0600 Subject: [PATCH] Allow init arguments to be in any order. --- libexec/rbenv-init | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/libexec/rbenv-init b/libexec/rbenv-init index ed440d13..5c120250 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -3,16 +3,19 @@ set -e [ -n "$RBENV_DEBUG" ] && set -x print="" -if [ "$1" = "-" ]; then - print=1 - shift -fi - no_rehash="" -if [ "$1" = "--no-rehash" ]; then - no_rehash=1 - shift -fi +for args in "$@" +do + if [ "$args" = "-" ]; then + print=1 + shift + fi + + if [ "$args" = "--no-rehash" ]; then + no_rehash=1 + shift + fi +done shell="$1" if [ -z "$shell" ]; then