update.sh: reject unknown long opts
I accidentally typed `brew update --greedy` instead of `brew upgrade --greedy` and got some strange output. This fix causes unrecognized long options to throw a usage message and exit like all the other subcommands. Before: ``` % brew update --greedy ==> Updating Homebrew... Usage: brew update-report [--auto-update] [--force] The Ruby implementation of brew update. Never called manually. [...] ``` After: ``` % brew update --greedy Error: Unrecognized option '--greedy' Usage: brew update, up [options] Fetch the newest version of Homebrew and all formulae from GitHub using git(1) and perform any necessary migrations. [...] ```
This commit is contained in:
parent
2432d01884
commit
85c9551cd3
@ -352,7 +352,11 @@ homebrew-update() {
|
||||
HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH=1
|
||||
;;
|
||||
--auto-update) export HOMEBREW_UPDATE_AUTO=1 ;;
|
||||
--*) ;;
|
||||
--*)
|
||||
onoe "Unknown option: ${option}"
|
||||
brew help update
|
||||
exit 1
|
||||
;;
|
||||
-*)
|
||||
[[ "${option}" == *v* ]] && HOMEBREW_VERBOSE=1
|
||||
[[ "${option}" == *q* ]] && HOMEBREW_QUIET=1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user