brew.sh: fix brew -v

`brew -v` was previously equivalent to `brew --version`, but it
currently returns the output of `brew help`. (This also occurs with
`brew -x`, where x is any single character.)

This is because the `-?` pattern matches `-` followed by any single
character. We need to quote it to capture the intended meaning.
This commit is contained in:
Carlo Cabrera 2024-07-30 17:09:11 +08:00
parent cae9660c36
commit 0f71de045e
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -166,7 +166,7 @@ case "$@" in
homebrew-list "$@" && exit 0
;;
# falls back to cmd/help.rb on a non-zero return
help | --help | -h | --usage | -? | "")
help | --help | -h | --usage | "-?" | "")
homebrew-help "$@" && exit 0
;;
esac