brew.sh: shift -v to the end of the parameter list earlier.

Fixes #17240
This commit is contained in:
Mike McQuaid 2024-05-07 08:57:57 +01:00
parent fc13eb83c8
commit 7a61b03e72
No known key found for this signature in database

View File

@ -508,6 +508,13 @@ HOMEBREW_CORE_REPOSITORY="${HOMEBREW_LIBRARY}/Taps/homebrew/homebrew-core"
# shellcheck disable=SC2034 # shellcheck disable=SC2034
HOMEBREW_CASK_REPOSITORY="${HOMEBREW_LIBRARY}/Taps/homebrew/homebrew-cask" 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. # commands that take a single or no arguments.
case "$1" in case "$1" in
--version | -v) --version | -v)
@ -793,13 +800,6 @@ EOS
fi fi
fi fi
if [[ "$1" == "-v" ]]
then
# Shift the -v to the end of the parameter list
shift
set -- "$@" -v
fi
for arg in "$@" for arg in "$@"
do do
[[ "${arg}" == "--" ]] && break [[ "${arg}" == "--" ]] && break