Skip to content

Commit

Permalink
Merge pull request #17192 from Homebrew/fix_brew_sh_args
Browse files Browse the repository at this point in the history
brew.sh: fix argument handling for a few commands.
  • Loading branch information
carlocab authored Apr 30, 2024
2 parents fe4392d + de8266b commit 2862bc2
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,6 @@ HOMEBREW_TEMP="${HOMEBREW_TEMP:-${HOMEBREW_DEFAULT_TEMP}}"
#
# commands that take a single or no arguments.
case "$1" in
--cellar)
echo "${HOMEBREW_CELLAR}"
exit 0
;;
--repository | --repo)
echo "${HOMEBREW_REPOSITORY}"
exit 0
;;
--caskroom)
echo "${HOMEBREW_PREFIX}/Caskroom"
exit 0
;;
--cache)
echo "${HOMEBREW_CACHE}"
exit 0
;;
formulae)
source "${HOMEBREW_LIBRARY}/Homebrew/cmd/formulae.sh"
homebrew-formulae
Expand All @@ -126,6 +110,22 @@ case "$1" in
esac
# functions that take multiple arguments or handle multiple commands.
case "$@" in
--cellar)
echo "${HOMEBREW_CELLAR}"
exit 0
;;
--repository | --repo)
echo "${HOMEBREW_REPOSITORY}"
exit 0
;;
--caskroom)
echo "${HOMEBREW_PREFIX}/Caskroom"
exit 0
;;
--cache)
echo "${HOMEBREW_CACHE}"
exit 0
;;
# falls back to cmd/--prefix.rb and cmd/--cellar.rb on a non-zero return
--prefix* | --cellar*)
source "${HOMEBREW_LIBRARY}/Homebrew/formula_path.sh"
Expand Down

0 comments on commit 2862bc2

Please # to comment.