diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index d6bc2450f8..abe2ed6bf6 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -508,6 +508,13 @@ HOMEBREW_CORE_REPOSITORY="${HOMEBREW_LIBRARY}/Taps/homebrew/homebrew-core" # shellcheck disable=SC2034 HOMEBREW_CASK_REPOSITORY="${HOMEBREW_LIBRARY}/Taps/homebrew/homebrew-cask" +# Shift the -v to the end of the parameter list +if [[ "$1" == "-v" ]] +then + shift + set -- "$@" -v +fi + # commands that take a single or no arguments. case "$1" in --version | -v) @@ -793,13 +800,6 @@ EOS fi fi -if [[ "$1" == "-v" ]] -then - # Shift the -v to the end of the parameter list - shift - set -- "$@" -v -fi - for arg in "$@" do [[ "${arg}" == "--" ]] && break