aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/brew.sh
diff options
context:
space:
mode:
authorMike McQuaid2016-10-03 18:38:46 +0100
committerGitHub2016-10-03 18:38:46 +0100
commit881fdcd25ebe6b91691295034a8d9fa2dfc6f158 (patch)
treea8d219e84fa831c00625010acc72a364e780c504 /Library/Homebrew/brew.sh
parentea5aff8d7cdf893207fde9457364bde3b8e5ae82 (diff)
parentd92a1ad58434fdb6852405f28ae54494083471b0 (diff)
downloadbrew-881fdcd25ebe6b91691295034a8d9fa2dfc6f158.tar.bz2
Merge pull request #1190 from vladshablinsky/no-autoupdate-on-help
brew.sh: don't autoupdate if --help passed
Diffstat (limited to 'Library/Homebrew/brew.sh')
-rw-r--r--Library/Homebrew/brew.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh
index 1ccd8832a..8ffee44b3 100644
--- a/Library/Homebrew/brew.sh
+++ b/Library/Homebrew/brew.sh
@@ -183,6 +183,15 @@ then
set -- "$@" -v
fi
+for arg in "$@"
+do
+ if [[ $arg = "--help" || $arg = "-h" || $arg = "--usage" || $arg = "-?" ]]
+ then
+ export HOMEBREW_HELP="1"
+ break
+ fi
+done
+
HOMEBREW_ARG_COUNT="$#"
HOMEBREW_COMMAND="$1"
shift
@@ -272,6 +281,7 @@ setup-analytics
report-analytics-screenview-command
update-preinstall() {
+ [[ -z "$HOMEBREW_HELP" ]] || return
[[ -z "$HOMEBREW_NO_AUTO_UPDATE" ]] || return
[[ -z "$HOMEBREW_UPDATE_PREINSTALL" ]] || return