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.
This commit is contained in:
Xu Cheng 2016-01-21 18:36:05 +08:00
parent 58e0249609
commit eb54a6b5d5

View File

@ -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.