Merge pull request #5643 from GauthamGoli/upgrade-args

cmd/upgrade: Use CLI::Parser to parse args
This commit is contained in:
Mike McQuaid 2019-01-29 20:00:19 +00:00 committed by GitHub
commit 0f270d8115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 249 additions and 55 deletions

View File

@ -148,6 +148,21 @@ module Homebrew
.gsub(/\*(.*?)\*/m, "#{Tty.underline}\\1#{Tty.reset}") .gsub(/\*(.*?)\*/m, "#{Tty.underline}\\1#{Tty.reset}")
end end
def formula_options
ARGV.formulae.each do |f|
next if f.options.empty?
f.options.each do |o|
name = o.flag
description = "`#{f.name}`: #{o.description}"
if name.end_with? "="
flag name, description: description
else
switch name, description: description
end
end
end
end
private private
def enable_switch(*names) def enable_switch(*names)

View File

@ -98,6 +98,7 @@ module Homebrew
"debugging the `--installed`/`--all` display mode." "debugging the `--installed`/`--all` display mode."
switch :verbose switch :verbose
switch :debug switch :debug
conflicts "--installed", "--all"
end end
end end

View File

@ -37,6 +37,7 @@ module Homebrew
description: "Search just the descriptions for provided <text>. If <text> is flanked by slashes, "\ description: "Search just the descriptions for provided <text>. If <text> is flanked by slashes, "\
"it is interpreted as a regular expression." "it is interpreted as a regular expression."
switch :verbose switch :verbose
conflicts "--search=", "--name=", "--description="
end end
end end

View File

@ -60,6 +60,8 @@ module Homebrew
"even if it would not be used during installation." "even if it would not be used during installation."
switch :verbose switch :verbose
switch :debug switch :debug
conflicts "--devel", "--HEAD"
conflicts "--build-from-source", "--build-bottle", "--force-bottle"
end end
end end

View File

@ -79,6 +79,7 @@ module Homebrew
switch :verbose, switch :verbose,
description: "See more verbose analytics data." description: "See more verbose analytics data."
switch :debug switch :debug
conflicts "--all", "--installed"
end end
end end

View File

@ -41,7 +41,7 @@
#: If `--devel` is passed, and <formula> defines it, install the development version. #: If `--devel` is passed, and <formula> defines it, install the development version.
#: #:
#: If `--HEAD` is passed, and <formula> defines it, install the HEAD version, #: If `--HEAD` is passed, and <formula> defines it, install the HEAD version,
#: aka master, trunk, unstable. #: aka. master, trunk, unstable.
#: #:
#: If `--keep-tmp` is passed, the temporary files created during installation #: If `--keep-tmp` is passed, the temporary files created during installation
#: are not deleted. #: are not deleted.
@ -85,7 +85,7 @@ module Homebrew
def install_args def install_args
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do
usage_banner <<~EOS usage_banner <<~EOS
`install` [<options>] formula `install` [<options>] <formula>
Install <formula>. Install <formula>.
@ -124,7 +124,7 @@ module Homebrew
switch "--devel", switch "--devel",
description: "If <formula> defines it, install the development version." description: "If <formula> defines it, install the development version."
switch "--HEAD", switch "--HEAD",
description: "If <formula> defines it, install the HEAD version, aka master, trunk, unstable." description: "If <formula> defines it, install the HEAD version, aka. master, trunk, unstable."
switch "--fetch-HEAD", switch "--fetch-HEAD",
description: "Fetch the upstream repository to detect if the HEAD installation of the "\ description: "Fetch the upstream repository to detect if the HEAD installation of the "\
"formula is outdated. Otherwise, the repository's HEAD will be checked for "\ "formula is outdated. Otherwise, the repository's HEAD will be checked for "\
@ -146,19 +146,10 @@ module Homebrew
"package into a Homebrew package." "package into a Homebrew package."
switch "-g", "--git", switch "-g", "--git",
description: "Create a Git repository, useful for creating patches to the software." description: "Create a Git repository, useful for creating patches to the software."
conflicts "--ignore-dependencies", "--only-dependencies"
ARGV.formulae.each do |f| conflicts "--devel", "--HEAD"
next if f.options.empty? conflicts "--build-from-source", "--build-bottle", "--force-bottle"
f.options.each do |o| formula_options
name = o.flag
description = "`#{f.name}`: #{o.description}"
if name.end_with? "="
flag name, description: description
else
switch name, description: description
end
end
end
end end
end end

View File

@ -29,6 +29,7 @@ module Homebrew
switch "--installed", switch "--installed",
description: "Show options for all installed formulae." description: "Show options for all installed formulae."
switch :debug switch :debug
conflicts "--all", "--installed"
end end
end end

View File

@ -46,6 +46,7 @@ module Homebrew
"formula is outdated. Otherwise, the repository's HEAD will be checked for "\ "formula is outdated. Otherwise, the repository's HEAD will be checked for "\
"updates when a new stable or devel version has been released." "updates when a new stable or devel version has been released."
switch :debug switch :debug
conflicts "--quiet", "--verbose", "--json="
end end
end end

View File

@ -1,8 +1,30 @@
#: * `reinstall` [`--display-times`] <formula>: #: * `reinstall` [`--debug`] [`--build-from-source`|`--force-bottle`] [`--keep-tmp`] [`--force`] [`--verbose`] [`--display-times`] <formula>:
#: Uninstall and then install <formula> (with existing install options). #: Uninstall and then install <formula> (with existing and any appended install options).
#:
#: If `--debug` (or `-d`) is passed and brewing fails, open an interactive debugging
#: session with access to IRB or a shell inside the temporary build directory.
#:
#: If `--build-from-source` (or `-s`) is passed, compile the specified <formula> from
#: source even if a bottle is provided. Dependencies will still be installed
#: from bottles if they are available.
#:
#: If `--force-bottle` is passed, install from a bottle if it exists for the
#: current or newest version of macOS, even if it would not normally be used
#: for installation.
#:
#: If `--keep-tmp` is passed, the temporary files created during installation
#: are not deleted.
#:
#: If `--force` (or `-f`) is passed, install without checking for previously
#: installed keg-only or non-migrated versions
#:
#: If `--verbose` (or `-v`) is passed, print the verification and postinstall steps.
#: #:
#: If `--display-times` is passed, install times for each formula are printed #: If `--display-times` is passed, install times for each formula are printed
#: at the end of the run. #: at the end of the run.
#:
#: Installation options specific to <formula> may be appended to the command,
#: and can be listed with `brew options` <formula>.
require "formula_installer" require "formula_installer"
require "development_tools" require "development_tools"
@ -17,16 +39,29 @@ module Homebrew
def reinstall_args def reinstall_args
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do
usage_banner <<~EOS usage_banner <<~EOS
`reinstall` [<option(s)>] <formula>: `reinstall` [<options>] <formula>
Uninstall and then install <formula> (with existing install options). Uninstall and then install <formula> (with existing and any appended install options).
EOS EOS
switch :debug,
description: "If brewing fails, open an interactive debugging session with access to IRB "\
"or a shell inside the temporary build directory"
switch "-s", "--build-from-source", switch "-s", "--build-from-source",
description: "Compile the formula> from source even if a bottle is available." description: "Compile <formula> from source even if a bottle is available."
switch "--force-bottle",
description: "Install from a bottle if it exists for the current or newest version of "\
"macOS, even if it would not normally be used for installation."
switch "--keep-tmp",
description: "Dont delete the temporary files created during installation."
switch :force,
description: "Install without checking for previously installed keg-only or "\
"non-migrated versions."
switch :verbose,
description: "Print the verification and postinstall steps."
switch "--display-times", switch "--display-times",
description: "Print install times for each formula at the end of the run." description: "Print install times for each formula at the end of the run."
switch :verbose conflicts "--build-from-source", "--force-bottle"
switch :debug formula_options
end end
end end

View File

@ -34,6 +34,7 @@ module Homebrew
switch :force switch :force
switch :verbose switch :verbose
switch :debug switch :debug
conflicts "--git", "--patch"
end end
end end

View File

@ -1,7 +1,19 @@
#: * `upgrade` [<install-options>] [`--fetch-HEAD`] [`--ignore-pinned`] [`--display-times`] [<formulae>]: #: * `upgrade` [`--debug`] [`--build-from-source`|`--force-bottle`] [`--fetch-HEAD`] [`--ignore-pinned`] [`--keep-tmp`] [`--force`] [`--verbose`] [`--display-times`] [<formula>] [<options> ...]:
#: Upgrade outdated, unpinned brews (with existing install options). #: Upgrade outdated, unpinned brews (with existing and any appended install options).
#: #:
#: Options for the `install` command are also valid here. #: If <formula> are given, upgrade only the specified brews (unless they
#: are pinned; see `pin`, `unpin`).
#:
#: If `--debug` (or `-d`) is passed and brewing fails, open an interactive debugging
#: session with access to IRB or a shell inside the temporary build directory.
#:
#: If `--build-from-source` (or `-s`) is passed, compile the specified <formula> from
#: source even if a bottle is provided. Dependencies will still be installed
#: from bottles if they are available.
#:
#: If `--force-bottle` is passed, install from a bottle if it exists for the
#: current or newest version of macOS, even if it would not normally be used
#: for installation.
#: #:
#: If `--fetch-HEAD` is passed, fetch the upstream repository to detect if #: If `--fetch-HEAD` is passed, fetch the upstream repository to detect if
#: the HEAD installation of the formula is outdated. Otherwise, the #: the HEAD installation of the formula is outdated. Otherwise, the
@ -11,11 +23,19 @@
#: If `--ignore-pinned` is passed, set a 0 exit code even if pinned formulae #: If `--ignore-pinned` is passed, set a 0 exit code even if pinned formulae
#: are not upgraded. #: are not upgraded.
#: #:
#: If `--keep-tmp` is passed, the temporary files created during installation
#: are not deleted.
#:
#: If `--force` (or `-f`) is passed, install without checking for previously
#: installed keg-only or non-migrated versions
#:
#: If `--verbose` (or `-v`) is passed, print the verification and postinstall steps.
#:
#: If `--display-times` is passed, install times for each formula are printed #: If `--display-times` is passed, install times for each formula are printed
#: at the end of the run. #: at the end of the run.
#: #:
#: If <formulae> are given, upgrade only the specified brews (unless they #: Additional options specific to <formula> may be appended to the command,
#: are pinned; see `pin`, `unpin`). #: and can be listed with `brew options` <formula>.
require "install" require "install"
require "reinstall" require "reinstall"
@ -23,10 +43,49 @@ require "formula_installer"
require "development_tools" require "development_tools"
require "messages" require "messages"
require "cleanup" require "cleanup"
require "cli_parser"
module Homebrew module Homebrew
module_function module_function
def upgrade_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`upgrade` [<options>] <formula>
Upgrade outdated, unpinned brews (with existing and any appended install options).
If <formula> are given, upgrade only the specified brews (unless they
are pinned; see `pin`, `unpin`).
EOS
switch :debug,
description: "If brewing fails, open an interactive debugging session with access to IRB "\
"or a shell inside the temporary build directory"
switch "-s", "--build-from-source",
description: "Compile <formula> from source even if a bottle is available."
switch "--force-bottle",
description: "Install from a bottle if it exists for the current or newest version of "\
"macOS, even if it would not normally be used for installation."
switch "--fetch-HEAD",
description: "Fetch the upstream repository to detect if the HEAD installation of the "\
"formula is outdated. Otherwise, the repository's HEAD will be checked for "\
"updates when a new stable or devel version has been released."
switch "--ignore-pinned",
description: "Set a 0 exit code even if pinned formulae are not upgraded."
switch "--keep-tmp",
description: "Dont delete the temporary files created during installation."
switch :force,
description: "Install without checking for previously installed keg-only or "\
"non-migrated versions."
switch :verbose,
description: "Print the verification and postinstall steps."
switch "--display-times",
description: "Print install times for each formula at the end of the run."
conflicts "--build-from-source", "--force-bottle"
formula_options
end
end
def upgrade def upgrade
if ARGV.include?("--cleanup") if ARGV.include?("--cleanup")
odisabled("'brew upgrade --cleanup'") odisabled("'brew upgrade --cleanup'")
@ -40,13 +99,13 @@ module Homebrew
if ARGV.named.empty? if ARGV.named.empty?
outdated = Formula.installed.select do |f| outdated = Formula.installed.select do |f|
f.outdated?(fetch_head: ARGV.fetch_head?) f.outdated?(fetch_head: args.fetch_HEAD?)
end end
exit 0 if outdated.empty? exit 0 if outdated.empty?
else else
outdated = ARGV.resolved_formulae.select do |f| outdated = ARGV.resolved_formulae.select do |f|
f.outdated?(fetch_head: ARGV.fetch_head?) f.outdated?(fetch_head: args.fetch_HEAD?)
end end
(ARGV.resolved_formulae - outdated).each do |f| (ARGV.resolved_formulae - outdated).each do |f|
@ -65,7 +124,7 @@ module Homebrew
outdated -= pinned outdated -= pinned
formulae_to_install = outdated.map(&:latest_formula) formulae_to_install = outdated.map(&:latest_formula)
if !pinned.empty? && !ARGV.include?("--ignore-pinned") if !pinned.empty? && !args.ignore_pinned?
ofail "Not upgrading #{pinned.count} pinned #{"package".pluralize(pinned.count)}:" ofail "Not upgrading #{pinned.count} pinned #{"package".pluralize(pinned.count)}:"
puts pinned.map { |f| "#{f.full_specified_name} #{f.pkg_version}" } * ", " puts pinned.map { |f| "#{f.full_specified_name} #{f.pkg_version}" } * ", "
end end
@ -144,7 +203,7 @@ module Homebrew
fi = FormulaInstaller.new(f) fi = FormulaInstaller.new(f)
fi.options = options fi.options = options
fi.build_bottle = ARGV.build_bottle? || (!f.bottle_defined? && f.build.bottle?) fi.build_bottle = args.build_bottle? || (!f.bottle_defined? && f.build.bottle?)
fi.installed_on_request = !ARGV.named.empty? fi.installed_on_request = !ARGV.named.empty?
fi.link_keg ||= keg_was_linked if keg_had_linked_opt fi.link_keg ||= keg_was_linked if keg_had_linked_opt
if tab if tab
@ -203,7 +262,7 @@ module Homebrew
next if formulae_to_upgrade.include?(f) next if formulae_to_upgrade.include?(f)
next if formulae_pinned.include?(f) next if formulae_pinned.include?(f)
if f.outdated?(fetch_head: ARGV.fetch_head?) if f.outdated?(fetch_head: args.fetch_HEAD?)
if f.pinned? if f.pinned?
formulae_pinned << f formulae_pinned << f
else else
@ -247,7 +306,7 @@ module Homebrew
checker = LinkageChecker.new(keg, cache_db: db) checker = LinkageChecker.new(keg, cache_db: db)
if checker.broken_library_linkage? if checker.broken_library_linkage?
if f.outdated?(fetch_head: ARGV.fetch_head?) if f.outdated?(fetch_head: args.fetch_HEAD?)
# Outdated formulae = pinned formulae (see function above) # Outdated formulae = pinned formulae (see function above)
formulae_pinned_and_outdated << f formulae_pinned_and_outdated << f
else else
@ -295,7 +354,7 @@ module Homebrew
return if kegs.empty? return if kegs.empty?
oh1 "Checking dependents for outdated formulae" if ARGV.verbose? oh1 "Checking dependents for outdated formulae" if args.verbose?
upgradable, pinned = upgradable_dependents(kegs, formulae).map(&:to_a) upgradable, pinned = upgradable_dependents(kegs, formulae).map(&:to_a)
upgradable.sort! { |a, b| depends_on(a, b) } upgradable.sort! { |a, b| depends_on(a, b) }
@ -310,7 +369,7 @@ module Homebrew
# Print the upgradable dependents. # Print the upgradable dependents.
if upgradable.empty? if upgradable.empty?
ohai "No dependents to upgrade" if ARGV.verbose? ohai "No dependents to upgrade" if args.verbose?
else else
ohai "Upgrading #{upgradable.count} #{"dependent".pluralize(upgradable.count)}:" ohai "Upgrading #{upgradable.count} #{"dependent".pluralize(upgradable.count)}:"
formulae_upgrades = upgradable.map do |f| formulae_upgrades = upgradable.map do |f|
@ -328,7 +387,7 @@ module Homebrew
# Assess the dependents tree again. # Assess the dependents tree again.
kegs = formulae_with_runtime_dependencies kegs = formulae_with_runtime_dependencies
oh1 "Checking dependents for broken library links" if ARGV.verbose? oh1 "Checking dependents for broken library links" if args.verbose?
reinstallable, pinned = broken_dependents(kegs, formulae).map(&:to_a) reinstallable, pinned = broken_dependents(kegs, formulae).map(&:to_a)
reinstallable.sort! { |a, b| depends_on(a, b) } reinstallable.sort! { |a, b| depends_on(a, b) }
@ -343,7 +402,7 @@ module Homebrew
# Print the broken dependents. # Print the broken dependents.
if reinstallable.empty? if reinstallable.empty?
ohai "No broken dependents to reinstall" if ARGV.verbose? ohai "No broken dependents to reinstall" if args.verbose?
else else
ohai "Reinstalling #{reinstallable.count} broken #{"dependent".pluralize(reinstallable.count)} from source:" ohai "Reinstalling #{reinstallable.count} broken #{"dependent".pluralize(reinstallable.count)} from source:"
puts reinstallable.map(&:full_specified_name).join(", ") puts reinstallable.map(&:full_specified_name).join(", ")

View File

@ -59,6 +59,7 @@ module Homebrew
switch "--HEAD", switch "--HEAD",
description: "Show usage of <formulae> by HEAD build." description: "Show usage of <formulae> by HEAD build."
switch :debug switch :debug
conflicts "--devel", "--HEAD"
end end
end end

View File

@ -104,6 +104,7 @@ module Homebrew
switch :quiet switch :quiet
switch :verbose switch :verbose
switch :debug switch :debug
conflicts "--no-audit", "--strict"
conflicts "--url", "--tag" conflicts "--url", "--tag"
end end
end end

View File

@ -59,6 +59,7 @@ module Homebrew
switch :force switch :force
switch :verbose switch :verbose
switch :debug switch :debug
conflicts "--autotools", "--cmake", "--meson"
end end
end end

View File

@ -41,6 +41,7 @@ module Homebrew
description: "Keep the temporary files created for the test." description: "Keep the temporary files created for the test."
switch :verbose switch :verbose
switch :debug switch :debug
conflicts "--devel", "--HEAD"
end end
end end

View File

@ -21,8 +21,9 @@ describe "brew reinstall", :integration_test do
end end
it "reinstalls a Formula even when one of the options is invalid" do it "reinstalls a Formula even when one of the options is invalid" do
expect { brew "reinstall", "testball", "--with-fo" } expect { brew "reinstall", "testball", "--invalid" }
.to output(/Error: invalid option: --with-fo/).to_stderr .to output(/Error: invalid option: --invalid/).to_stderr
.and not_to_output.to_stdout
.and be_a_failure .and be_a_failure
end end

View File

@ -279,7 +279,7 @@ these flags should only appear after a command.
If `--devel` is passed, and *`formula`* defines it, install the development version. If `--devel` is passed, and *`formula`* defines it, install the development version.
If `--HEAD` is passed, and *`formula`* defines it, install the HEAD version, If `--HEAD` is passed, and *`formula`* defines it, install the HEAD version,
aka master, trunk, unstable. aka. master, trunk, unstable.
If `--keep-tmp` is passed, the temporary files created during installation If `--keep-tmp` is passed, the temporary files created during installation
are not deleted. are not deleted.
@ -414,12 +414,34 @@ these flags should only appear after a command.
If `--syntax` is passed, also syntax-check all of Homebrew's Ruby files. If `--syntax` is passed, also syntax-check all of Homebrew's Ruby files.
* `reinstall` [`--display-times`] *`formula`*: * `reinstall` [`--debug`] [`--build-from-source`|`--force-bottle`] [`--keep-tmp`] [`--force`] [`--verbose`] [`--display-times`] *`formula`*:
Uninstall and then install *`formula`* (with existing install options). Uninstall and then install *`formula`* (with existing and any appended install options).
If `--debug` (or `-d`) is passed and brewing fails, open an interactive debugging
session with access to IRB or a shell inside the temporary build directory.
If `--build-from-source` (or `-s`) is passed, compile the specified *`formula`* from
source even if a bottle is provided. Dependencies will still be installed
from bottles if they are available.
If `--force-bottle` is passed, install from a bottle if it exists for the
current or newest version of macOS, even if it would not normally be used
for installation.
If `--keep-tmp` is passed, the temporary files created during installation
are not deleted.
If `--force` (or `-f`) is passed, install without checking for previously
installed keg-only or non-migrated versions
If `--verbose` (or `-v`) is passed, print the verification and postinstall steps.
If `--display-times` is passed, install times for each formula are printed If `--display-times` is passed, install times for each formula are printed
at the end of the run. at the end of the run.
Installation options specific to *`formula`* may be appended to the command,
and can be listed with `brew options` *`formula`*.
* `search`, `-S`: * `search`, `-S`:
Display all locally available formulae (including tapped ones). Display all locally available formulae (including tapped ones).
No online search is performed. No online search is performed.
@ -588,10 +610,22 @@ these flags should only appear after a command.
`repositories`) using `git`(1) to their latest `origin/master`. Note this `repositories`) using `git`(1) to their latest `origin/master`. Note this
will destroy all your uncommitted or committed changes. will destroy all your uncommitted or committed changes.
* `upgrade` [*`install-options`*] [`--fetch-HEAD`] [`--ignore-pinned`] [`--display-times`] [*`formulae`*]: * `upgrade` [`--debug`] [`--build-from-source`|`--force-bottle`] [`--fetch-HEAD`] [`--ignore-pinned`] [`--keep-tmp`] [`--force`] [`--verbose`] [`--display-times`] [*`formula`*] [*`options`* ...]:
Upgrade outdated, unpinned brews (with existing install options). Upgrade outdated, unpinned brews (with existing and any appended install options).
Options for the `install` command are also valid here. If *`formula`* are given, upgrade only the specified brews (unless they
are pinned; see `pin`, `unpin`).
If `--debug` (or `-d`) is passed and brewing fails, open an interactive debugging
session with access to IRB or a shell inside the temporary build directory.
If `--build-from-source` (or `-s`) is passed, compile the specified *`formula`* from
source even if a bottle is provided. Dependencies will still be installed
from bottles if they are available.
If `--force-bottle` is passed, install from a bottle if it exists for the
current or newest version of macOS, even if it would not normally be used
for installation.
If `--fetch-HEAD` is passed, fetch the upstream repository to detect if If `--fetch-HEAD` is passed, fetch the upstream repository to detect if
the HEAD installation of the formula is outdated. Otherwise, the the HEAD installation of the formula is outdated. Otherwise, the
@ -601,11 +635,19 @@ these flags should only appear after a command.
If `--ignore-pinned` is passed, set a 0 exit code even if pinned formulae If `--ignore-pinned` is passed, set a 0 exit code even if pinned formulae
are not upgraded. are not upgraded.
If `--keep-tmp` is passed, the temporary files created during installation
are not deleted.
If `--force` (or `-f`) is passed, install without checking for previously
installed keg-only or non-migrated versions
If `--verbose` (or `-v`) is passed, print the verification and postinstall steps.
If `--display-times` is passed, install times for each formula are printed If `--display-times` is passed, install times for each formula are printed
at the end of the run. at the end of the run.
If *`formulae`* are given, upgrade only the specified brews (unless they Additional options specific to *`formula`* may be appended to the command,
are pinned; see `pin`, `unpin`). and can be listed with `brew options` *`formula`*.
* `uses` [`--installed`] [`--recursive`] [`--include-build`] [`--include-test`] [`--include-optional`] [`--skip-recommended`] [`--devel`|`--HEAD`] *`formulae`*: * `uses` [`--installed`] [`--recursive`] [`--include-build`] [`--include-test`] [`--include-optional`] [`--skip-recommended`] [`--devel`|`--HEAD`] *`formulae`*:
Show the formulae that specify *`formulae`* as a dependency. When given Show the formulae that specify *`formulae`* as a dependency. When given

View File

@ -285,7 +285,7 @@ If \fB\-\-include\-test\fR is passed, install testing dependencies\. These are o
If \fB\-\-devel\fR is passed, and \fIformula\fR defines it, install the development version\. If \fB\-\-devel\fR is passed, and \fIformula\fR defines it, install the development version\.
. .
.IP .IP
If \fB\-\-HEAD\fR is passed, and \fIformula\fR defines it, install the HEAD version, aka master, trunk, unstable\. If \fB\-\-HEAD\fR is passed, and \fIformula\fR defines it, install the HEAD version, aka\. master, trunk, unstable\.
. .
.IP .IP
If \fB\-\-keep\-tmp\fR is passed, the temporary files created during installation are not deleted\. If \fB\-\-keep\-tmp\fR is passed, the temporary files created during installation are not deleted\.
@ -426,12 +426,33 @@ If \fB\-\-aliases\fR is passed, also verify any alias symlinks in each tap\.
If \fB\-\-syntax\fR is passed, also syntax\-check all of Homebrew\'s Ruby files\. If \fB\-\-syntax\fR is passed, also syntax\-check all of Homebrew\'s Ruby files\.
. .
.TP .TP
\fBreinstall\fR [\fB\-\-display\-times\fR] \fIformula\fR \fBreinstall\fR [\fB\-\-debug\fR] [\fB\-\-build\-from\-source\fR|\fB\-\-force\-bottle\fR] [\fB\-\-keep\-tmp\fR] [\fB\-\-force\fR] [\fB\-\-verbose\fR] [\fB\-\-display\-times\fR] \fIformula\fR
Uninstall and then install \fIformula\fR (with existing install options)\. Uninstall and then install \fIformula\fR (with existing and any appended install options)\.
.
.IP
If \fB\-\-debug\fR (or \fB\-d\fR) is passed and brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory\.
.
.IP
If \fB\-\-build\-from\-source\fR (or \fB\-s\fR) is passed, compile the specified \fIformula\fR from source even if a bottle is provided\. Dependencies will still be installed from bottles if they are available\.
.
.IP
If \fB\-\-force\-bottle\fR is passed, install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation\.
.
.IP
If \fB\-\-keep\-tmp\fR is passed, the temporary files created during installation are not deleted\.
.
.IP
If \fB\-\-force\fR (or \fB\-f\fR) is passed, install without checking for previously installed keg\-only or non\-migrated versions
.
.IP
If \fB\-\-verbose\fR (or \fB\-v\fR) is passed, print the verification and postinstall steps\.
. .
.IP .IP
If \fB\-\-display\-times\fR is passed, install times for each formula are printed at the end of the run\. If \fB\-\-display\-times\fR is passed, install times for each formula are printed at the end of the run\.
. .
.IP
Installation options specific to \fIformula\fR may be appended to the command, and can be listed with \fBbrew options\fR \fIformula\fR\.
.
.TP .TP
\fBsearch\fR, \fB\-S\fR \fBsearch\fR, \fB\-S\fR
Display all locally available formulae (including tapped ones)\. No online search is performed\. Display all locally available formulae (including tapped ones)\. No online search is performed\.
@ -601,11 +622,20 @@ If \fB\-\-force\fR (or \fB\-f\fR) is specified then always do a slower, full upd
Fetches and resets Homebrew and all tap repositories (or the specified \fBrepositories\fR) using \fBgit\fR(1) to their latest \fBorigin/master\fR\. Note this will destroy all your uncommitted or committed changes\. Fetches and resets Homebrew and all tap repositories (or the specified \fBrepositories\fR) using \fBgit\fR(1) to their latest \fBorigin/master\fR\. Note this will destroy all your uncommitted or committed changes\.
. .
.TP .TP
\fBupgrade\fR [\fIinstall\-options\fR] [\fB\-\-fetch\-HEAD\fR] [\fB\-\-ignore\-pinned\fR] [\fB\-\-display\-times\fR] [\fIformulae\fR] \fBupgrade\fR [\fB\-\-debug\fR] [\fB\-\-build\-from\-source\fR|\fB\-\-force\-bottle\fR] [\fB\-\-fetch\-HEAD\fR] [\fB\-\-ignore\-pinned\fR] [\fB\-\-keep\-tmp\fR] [\fB\-\-force\fR] [\fB\-\-verbose\fR] [\fB\-\-display\-times\fR] [\fIformula\fR] [\fIoptions\fR \.\.\.]
Upgrade outdated, unpinned brews (with existing install options)\. Upgrade outdated, unpinned brews (with existing and any appended install options)\.
. .
.IP .IP
Options for the \fBinstall\fR command are also valid here\. If \fIformula\fR are given, upgrade only the specified brews (unless they are pinned; see \fBpin\fR, \fBunpin\fR)\.
.
.IP
If \fB\-\-debug\fR (or \fB\-d\fR) is passed and brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory\.
.
.IP
If \fB\-\-build\-from\-source\fR (or \fB\-s\fR) is passed, compile the specified \fIformula\fR from source even if a bottle is provided\. Dependencies will still be installed from bottles if they are available\.
.
.IP
If \fB\-\-force\-bottle\fR is passed, install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation\.
. .
.IP .IP
If \fB\-\-fetch\-HEAD\fR is passed, fetch the upstream repository to detect if the HEAD installation of the formula is outdated\. Otherwise, the repository\'s HEAD will be checked for updates when a new stable or devel version has been released\. If \fB\-\-fetch\-HEAD\fR is passed, fetch the upstream repository to detect if the HEAD installation of the formula is outdated\. Otherwise, the repository\'s HEAD will be checked for updates when a new stable or devel version has been released\.
@ -614,10 +644,19 @@ If \fB\-\-fetch\-HEAD\fR is passed, fetch the upstream repository to detect if t
If \fB\-\-ignore\-pinned\fR is passed, set a 0 exit code even if pinned formulae are not upgraded\. If \fB\-\-ignore\-pinned\fR is passed, set a 0 exit code even if pinned formulae are not upgraded\.
. .
.IP .IP
If \fB\-\-keep\-tmp\fR is passed, the temporary files created during installation are not deleted\.
.
.IP
If \fB\-\-force\fR (or \fB\-f\fR) is passed, install without checking for previously installed keg\-only or non\-migrated versions
.
.IP
If \fB\-\-verbose\fR (or \fB\-v\fR) is passed, print the verification and postinstall steps\.
.
.IP
If \fB\-\-display\-times\fR is passed, install times for each formula are printed at the end of the run\. If \fB\-\-display\-times\fR is passed, install times for each formula are printed at the end of the run\.
. .
.IP .IP
If \fIformulae\fR are given, upgrade only the specified brews (unless they are pinned; see \fBpin\fR, \fBunpin\fR)\. Additional options specific to \fIformula\fR may be appended to the command, and can be listed with \fBbrew options\fR \fIformula\fR\.
. .
.TP .TP
\fBuses\fR [\fB\-\-installed\fR] [\fB\-\-recursive\fR] [\fB\-\-include\-build\fR] [\fB\-\-include\-test\fR] [\fB\-\-include\-optional\fR] [\fB\-\-skip\-recommended\fR] [\fB\-\-devel\fR|\fB\-\-HEAD\fR] \fIformulae\fR \fBuses\fR [\fB\-\-installed\fR] [\fB\-\-recursive\fR] [\fB\-\-include\-build\fR] [\fB\-\-include\-test\fR] [\fB\-\-include\-optional\fR] [\fB\-\-skip\-recommended\fR] [\fB\-\-devel\fR|\fB\-\-HEAD\fR] \fIformulae\fR