From eb54a6b5d5b05bfd9cc910a9633c35821c49c98f Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Thu, 21 Jan 2016 18:36:05 +0800 Subject: [PATCH] update-bash: handle option flags like -vd Per @UniqMartin's advice, the original code will fail to handle flags like `-vd`, because once a case is handled, no other cases are evaluate. --- Library/Homebrew/cmd/update-bash.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cmd/update-bash.sh b/Library/Homebrew/cmd/update-bash.sh index e72f3f196e..ce80a5a9bd 100755 --- a/Library/Homebrew/cmd/update-bash.sh +++ b/Library/Homebrew/cmd/update-bash.sh @@ -243,9 +243,10 @@ update-bash() { --rebase) HOMEBREW_REBASE=1 ;; --simulate-from-current-branch) HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH=1 ;; --*) ;; - -*v*) HOMEBREW_VERBOSE=1 ;; - -*d*) HOMEBREW_DEBUG=1 ;; - -*) ;; + -*) + [[ "$i" = *v* ]] && HOMEBREW_VERBOSE=1; + [[ "$i" = *d* ]] && HOMEBREW_DEBUG=1; + ;; *) odie <<-EOS This command updates brew itself, and does not take formula names.