aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMike McQuaid2015-04-26 19:38:50 +0100
committerMike McQuaid2015-04-26 19:40:33 +0100
commitc72505925184d305387ba6fab40c9501e7b3881b (patch)
treecdf838b3c8a7cd85ec1d22d0f5358b33187d3430 /Library/Homebrew/cmd
parent8fe0b5681056fe2540aba05721bfc6cde363e8d8 (diff)
downloadbrew-c72505925184d305387ba6fab40c9501e7b3881b.tar.bz2
upgrade: announce usage of --all.
Tell users that we will soon be migrating `--all` so it is required if you wish to upgrade all formulae. Closes Homebrew/homebrew#38572.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/upgrade.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index 10d323b14..8ba3eb8fc 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -5,10 +5,17 @@ module Homebrew
def upgrade
Homebrew.perform_preinstall_checks
- if ARGV.named.empty?
+ if ARGV.include?("--all") || ARGV.named.empty?
+ unless ARGV.include? "--all"
+ opoo <<-EOS.undent
+ brew upgrade with no arguments will change behaviour soon!
+ It currently upgrades all formula but this will soon change to require '--all'.
+ Please update any workflows, documentation and scripts!
+ EOS
+ end
outdated = Homebrew.outdated_brews(Formula.installed)
exit 0 if outdated.empty?
- else
+ elsif ARGV.named.any?
outdated = Homebrew.outdated_brews(ARGV.formulae)
(ARGV.formulae - outdated).each do |f|
@@ -20,6 +27,11 @@ module Homebrew
end
end
exit 1 if outdated.empty?
+ else
+ # This will currently never be reached but is implemented to make the
+ # migration to --all easier in the future (as just the ARGV.named.empty?
+ # will need removed above).
+ odie "Either --all or one or more formulae must be specified!"
end
unless upgrade_pinned?