Merge pull request #8813 from reitermarkus/cask-commands

Allow all cask options for `brew reinstall` and `brew upgrade`.
This commit is contained in:
Markus Reiter 2020-10-08 12:00:07 +02:00 committed by GitHub
commit c9e2a06ff5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 584 additions and 537 deletions

View File

@ -79,70 +79,6 @@ module Cask
EOS EOS
end end
OPTIONS = [
[:flag, "--appdir=", {
description: "Target location for Applications. " \
"Default: `#{Config::DEFAULT_DIRS[:appdir]}`",
}],
[:flag, "--colorpickerdir=", {
description: "Target location for Color Pickers. " \
"Default: `#{Config::DEFAULT_DIRS[:colorpickerdir]}`",
}],
[:flag, "--prefpanedir=", {
description: "Target location for Preference Panes. " \
"Default: `#{Config::DEFAULT_DIRS[:prefpanedir]}`",
}],
[:flag, "--qlplugindir=", {
description: "Target location for QuickLook Plugins. " \
"Default: `#{Config::DEFAULT_DIRS[:qlplugindir]}`",
}],
[:flag, "--mdimporterdir=", {
description: "Target location for Spotlight Plugins. " \
"Default: `#{Config::DEFAULT_DIRS[:mdimporterdir]}`",
}],
[:flag, "--dictionarydir=", {
description: "Target location for Dictionaries. " \
"Default: `#{Config::DEFAULT_DIRS[:dictionarydir]}`",
}],
[:flag, "--fontdir=", {
description: "Target location for Fonts. " \
"Default: `#{Config::DEFAULT_DIRS[:fontdir]}`",
}],
[:flag, "--servicedir=", {
description: "Target location for Services. " \
"Default: `#{Config::DEFAULT_DIRS[:servicedir]}`",
}],
[:flag, "--input_methoddir=", {
description: "Target location for Input Methods. " \
"Default: `#{Config::DEFAULT_DIRS[:input_methoddir]}`",
}],
[:flag, "--internet_plugindir=", {
description: "Target location for Internet Plugins. " \
"Default: `#{Config::DEFAULT_DIRS[:internet_plugindir]}`",
}],
[:flag, "--audio_unit_plugindir=", {
description: "Target location for Audio Unit Plugins. " \
"Default: `#{Config::DEFAULT_DIRS[:audio_unit_plugindir]}`",
}],
[:flag, "--vst_plugindir=", {
description: "Target location for VST Plugins. " \
"Default: `#{Config::DEFAULT_DIRS[:vst_plugindir]}`",
}],
[:flag, "--vst3_plugindir=", {
description: "Target location for VST3 Plugins. " \
"Default: `#{Config::DEFAULT_DIRS[:vst3_plugindir]}`",
}],
[:flag, "--screen_saverdir=", {
description: "Target location for Screen Savers. " \
"Default: `#{Config::DEFAULT_DIRS[:screen_saverdir]}`",
}],
[:comma_array, "--language", {
description: "Set language of the Cask to install. The first matching " \
"language is used, otherwise the default language on the Cask. " \
"The default value is the `language of your system`",
}],
].freeze
def self.parser(&block) def self.parser(&block)
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do
if block_given? if block_given?
@ -155,9 +91,7 @@ module Cask
EOS EOS
end end
OPTIONS.each do |option| cask_options
send(*option)
end
end end
end end

View File

@ -13,16 +13,25 @@ module Cask
"Upgrades all outdated casks or the specified casks." "Upgrades all outdated casks or the specified casks."
end end
OPTIONS = [
[:switch, "--skip-cask-deps", {
description: "Skip installing cask dependencies.",
}],
[:switch, "--greedy", {
description: "Also include casks with `auto_updates true` or `version :latest`.",
}],
].freeze
def self.parser def self.parser
super do super do
switch "--force", switch "--force",
description: "Force overwriting existing files." description: "Force overwriting existing files."
switch "--skip-cask-deps",
description: "Skip installing cask dependencies."
switch "--greedy",
description: "Also include casks which specify `auto_updates true` or `version :latest`."
switch "--dry-run", switch "--dry-run",
description: "Show what would be upgraded, but do not actually upgrade anything." description: "Show what would be upgraded, but do not actually upgrade anything."
OPTIONS.each do |option|
send(*option)
end
end end
end end

View File

@ -23,21 +23,33 @@ module Homebrew
super(@args) super(@args)
end end
def to_casks
@to_casks ||= to_formulae_and_casks(only: :cask).freeze
end
def to_formulae def to_formulae
@to_formulae ||= to_formulae_and_casks(only: :formula).freeze @to_formulae ||= to_formulae_and_casks(only: :formula).freeze
end end
def to_formulae_and_casks(only: nil) def to_formulae_and_casks(only: nil, method: nil)
@to_formulae_and_casks ||= {} @to_formulae_and_casks ||= {}
@to_formulae_and_casks[only] ||= begin @to_formulae_and_casks[only] ||= begin
to_objects(only: only).reject { |o| o.is_a?(Tap) }.freeze to_objects(only: only, method: method).reject { |o| o.is_a?(Tap) }.freeze
end end
end end
def load_formula_or_cask(name, only: nil) def load_formula_or_cask(name, only: nil, method: nil)
if only != :cask if only != :cask
begin begin
formula = Formulary.factory(name, spec, force_bottle: @force_bottle, flags: @flags) formula = case method
when nil, :factory
Formulary.factory(name, *spec, force_bottle: @force_bottle, flags: @flags)
when :resolve
Formulary.resolve(name, spec: spec, force_bottle: @force_bottle, flags: @flags)
else
raise
end
warn_if_cask_conflicts(name, "formula") unless only == :formula warn_if_cask_conflicts(name, "formula") unless only == :formula
return formula return formula
rescue FormulaUnavailableError => e rescue FormulaUnavailableError => e
@ -47,8 +59,8 @@ module Homebrew
if only != :formula if only != :formula
begin begin
return Cask::CaskLoader.load(name) return Cask::CaskLoader.load(name, config: Cask::Config.from_args(@parent))
rescue Cask::CaskUnavailableError rescue Cask::CaskUnavailableError => e
raise e if only == :cask raise e if only == :cask
end end
end end
@ -58,48 +70,33 @@ module Homebrew
private :load_formula_or_cask private :load_formula_or_cask
def resolve_formula(name) def resolve_formula(name)
Formulary.resolve(name, spec: spec(nil), force_bottle: @force_bottle, flags: @flags) Formulary.resolve(name, spec: spec, force_bottle: @force_bottle, flags: @flags)
end end
private :resolve_formula private :resolve_formula
def to_resolved_formulae def to_resolved_formulae
@to_resolved_formulae ||= (downcased_unique_named - homebrew_tap_cask_names).map do |name| @to_resolved_formulae ||= to_formulae_and_casks(only: :formula, method: :resolve)
resolve_formula(name) .freeze
end.uniq(&:name).freeze
end end
def to_resolved_formulae_to_casks def to_resolved_formulae_to_casks
@to_resolved_formulae_to_casks ||= begin @to_resolved_formulae_to_casks ||= to_formulae_and_casks(method: :resolve)
resolved_formulae = [] .partition { |o| o.is_a?(Formula) }
casks = [] .map(&:freeze).freeze
downcased_unique_named.each do |name|
resolved_formulae << resolve_formula(name)
warn_if_cask_conflicts(name, "formula")
rescue FormulaUnavailableError
begin
casks << Cask::CaskLoader.load(name)
rescue Cask::CaskUnavailableError
raise "No available formula or cask with the name \"#{name}\""
end
end
[resolved_formulae.freeze, casks.freeze].freeze
end
end end
# Convert named arguments to `Tap`, `Formula` or `Cask` objects. # Convert named arguments to `Tap`, `Formula` or `Cask` objects.
# If both a formula and cask exist with the same name, returns the # If both a formula and cask exist with the same name, returns the
# formula and prints a warning unless `only` is specified. # formula and prints a warning unless `only` is specified.
def to_objects(only: nil) def to_objects(only: nil, method: nil)
@to_objects ||= {} @to_objects ||= {}
@to_objects[only] ||= downcased_unique_named.flat_map do |name| @to_objects[only] ||= downcased_unique_named.flat_map do |name|
next Tap.fetch(name) if only == :tap || (only.nil? && name.count("/") == 1 && !name.start_with?("./", "/")) next Tap.fetch(name) if only == :tap || (only.nil? && name.count("/") == 1 && !name.start_with?("./", "/"))
load_formula_or_cask(name, only: only) load_formula_or_cask(name, only: only, method: method)
end.uniq.freeze end.uniq.freeze
end end
private :to_objects
def to_formulae_paths def to_formulae_paths
to_paths(only: :formulae) to_paths(only: :formulae)
@ -132,12 +129,6 @@ module Homebrew
end.uniq.freeze end.uniq.freeze
end end
def to_casks
@to_casks ||= downcased_unique_named
.map { |name| Cask::CaskLoader.load(name, config: Cask::Config.from_args(@parent)) }
.freeze
end
def to_kegs def to_kegs
@to_kegs ||= downcased_unique_named.map do |name| @to_kegs ||= downcased_unique_named.map do |name|
resolve_keg name resolve_keg name
@ -187,9 +178,10 @@ module Homebrew
end.uniq end.uniq
end end
def spec(default = :stable) def spec
@override_spec || default @override_spec
end end
private :spec
def resolve_keg(name) def resolve_keg(name)
raise UsageError if name.blank? raise UsageError if name.blank?

View File

@ -1,6 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require "env_config" require "env_config"
require "cask/config"
require "cli/args" require "cli/args"
require "optparse" require "optparse"
require "set" require "set"
@ -26,12 +27,78 @@ module Homebrew
end end
end end
def self.global_cask_options
[
[:flag, "--appdir=", {
description: "Target location for Applications. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:appdir]}`",
}],
[:flag, "--colorpickerdir=", {
description: "Target location for Color Pickers. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:colorpickerdir]}`",
}],
[:flag, "--prefpanedir=", {
description: "Target location for Preference Panes. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:prefpanedir]}`",
}],
[:flag, "--qlplugindir=", {
description: "Target location for QuickLook Plugins. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:qlplugindir]}`",
}],
[:flag, "--mdimporterdir=", {
description: "Target location for Spotlight Plugins. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:mdimporterdir]}`",
}],
[:flag, "--dictionarydir=", {
description: "Target location for Dictionaries. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:dictionarydir]}`",
}],
[:flag, "--fontdir=", {
description: "Target location for Fonts. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:fontdir]}`",
}],
[:flag, "--servicedir=", {
description: "Target location for Services. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:servicedir]}`",
}],
[:flag, "--input_methoddir=", {
description: "Target location for Input Methods. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:input_methoddir]}`",
}],
[:flag, "--internet_plugindir=", {
description: "Target location for Internet Plugins. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:internet_plugindir]}`",
}],
[:flag, "--audio_unit_plugindir=", {
description: "Target location for Audio Unit Plugins. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:audio_unit_plugindir]}`",
}],
[:flag, "--vst_plugindir=", {
description: "Target location for VST Plugins. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:vst_plugindir]}`",
}],
[:flag, "--vst3_plugindir=", {
description: "Target location for VST3 Plugins. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:vst3_plugindir]}`",
}],
[:flag, "--screen_saverdir=", {
description: "Target location for Screen Savers. " \
"Default: `#{Cask::Config::DEFAULT_DIRS[:screen_saverdir]}`",
}],
[:comma_array, "--language", {
description: "Set language of the Cask to install. The first matching " \
"language is used, otherwise the default language on the Cask. " \
"The default value is the `language of your system`",
}],
]
end
def self.global_options def self.global_options
[ [
["-d", "--debug", "Display any debugging information."], ["-d", "--debug", "Display any debugging information."],
["-q", "--quiet", "Suppress any warnings."], ["-q", "--quiet", "Suppress any warnings."],
["-v", "--verbose", "Make some output more verbose."], ["-v", "--verbose", "Make some output more verbose."],
["-h", "--help", "Show this message."], ["-h", "--help", "Show this message."],
] ]
end end
@ -211,6 +278,8 @@ module Homebrew
else else
switch name, description: description switch name, description: description
end end
conflicts "--cask", name
end end
end end
end end
@ -254,6 +323,13 @@ module Homebrew
.gsub(/\*(.*?)\*/m, "#{Tty.underline}\\1#{Tty.reset}") .gsub(/\*(.*?)\*/m, "#{Tty.underline}\\1#{Tty.reset}")
end end
def cask_options
self.class.global_cask_options.each do |method, *args, **options|
send(method, *args, **options)
conflicts "--formula", args.last
end
end
def formula_options def formula_options
@formula_options = true @formula_options = true
end end
@ -379,11 +455,13 @@ module Homebrew
def check_named_args(args) def check_named_args(args)
min_exception = case @min_named_type min_exception = case @min_named_type
when :cask when :cask
Cask::CaskUnspecifiedError.new Cask::CaskUnspecifiedError
when :formula when :formula
FormulaUnspecifiedError.new FormulaUnspecifiedError
when :formula_or_cask
FormulaOrCaskUnspecifiedError
when :keg when :keg
KegUnspecifiedError.new KegUnspecifiedError
else else
MinNamedArgumentsError.new(@min_named_args) MinNamedArgumentsError.new(@min_named_args)
end end
@ -454,29 +532,18 @@ module Homebrew
class MaxNamedArgumentsError < UsageError class MaxNamedArgumentsError < UsageError
def initialize(maximum) def initialize(maximum)
message = case maximum super case maximum
when 0 when 0
"this command does not take named arguments" "This command does not take named arguments."
when 1
"this command does not take multiple named arguments"
else else
"this command does not take more than #{maximum} named arguments" "This command does not take more than #{maximum} named #{"argument".pluralize(maximum)}"
end end
super message
end end
end end
class MinNamedArgumentsError < UsageError class MinNamedArgumentsError < UsageError
def initialize(minimum) def initialize(minimum)
message = case minimum super "This command requires at least #{minimum} named #{"argument".pluralize(minimum)}."
when 1
"this command requires a named argument"
when 2
"this command requires multiple named arguments"
else
"this command requires at least #{minimum} named arguments"
end
super message
end end
end end
end end

View File

@ -18,128 +18,111 @@ module Homebrew
module_function module_function
def install_args def install_args
cask_only_options = [
[:switch, "--cask", "--casks", {
description: "Treat all named arguments as casks.",
}],
*Cask::Cmd::OPTIONS,
*Cask::Cmd::AbstractCommand::OPTIONS,
*Cask::Cmd::Install::OPTIONS,
]
formula_only_options = [
[:switch, "--formula", "--formulae", {
description: "Treat all named arguments as formulae.",
}],
[:flag, "--env=", {
description: "If `std` is passed, use the standard build environment instead of superenv. "\
"If `super` is passed, use superenv even if the formula specifies the "\
"standard build environment.",
}],
[:switch, "--ignore-dependencies", {
description: "An unsupported Homebrew development flag to skip installing any dependencies of "\
"any kind. If the dependencies are not already present, the formula will have issues. "\
"If you're not developing Homebrew, consider adjusting your PATH rather than "\
"using this flag.",
}],
[:switch, "--only-dependencies", {
description: "Install the dependencies with specified options but do not install the "\
"formula itself.",
}],
[:flag, "--cc=", {
description: "Attempt to compile using the specified <compiler>, which should be the "\
"name of the compiler's executable, e.g. `gcc-7` for GCC 7. "\
"In order to use LLVM's clang, specify `llvm_clang`. To use the "\
"Apple-provided clang, specify `clang`. This option will only accept "\
"compilers that are provided by Homebrew or bundled with macOS. "\
"Please do not file issues if you encounter errors while using this option.",
}],
[:switch, "-s", "--build-from-source", {
description: "Compile <formula> from source even if a bottle is provided. "\
"Dependencies will still be installed from bottles if they are 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, "--include-test", {
description: "Install testing dependencies required to run `brew test` <formula>.",
}],
[:switch, "--HEAD", {
description: "If <formula> defines it, install the HEAD version, aka. master, trunk, unstable.",
}], [: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 only be checked for "\
"updates when a new stable or development version has been released.",
}], [:switch, "--keep-tmp", {
description: "Retain the temporary files created during installation.",
}], [:switch, "--build-bottle", {
description: "Prepare the formula for eventual bottling during installation, skipping any "\
"post-install steps.",
}],
[:flag, "--bottle-arch=", {
depends_on: "--build-bottle",
description: "Optimise bottles for the specified architecture rather than the oldest "\
"architecture supported by the version of macOS the bottles are built on.",
}],
[:switch, "--display-times", {
env: :display_install_times,
description: "Print install times for each formula at the end of the run.",
}],
[:switch, "-i", "--interactive", {
description: "Download and patch <formula>, then open a shell. This allows the user to "\
"run `./configure --help` and otherwise determine how to turn the software "\
"package into a Homebrew package.",
}],
[:switch, "-g", "--git", {
description: "Create a Git repository, useful for creating patches to the software.",
}]
]
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do
usage_banner <<~EOS usage_banner <<~EOS
`install` [<options>] <formula> `install` [<options>] <formula>|<cask>
Install <formula>. Additional options specific to <formula> may be appended to the command. Install a <formula> or <cask>. Additional options specific to a <formula> may be
appended to the command.
Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for
installed formulae or, every 30 days, for all formulae. the installed formulae or, every 30 days, for all formulae.
EOS EOS
switch "-d", "--debug", switch "-d", "--debug",
description: "If brewing fails, open an interactive debugging session with access to IRB "\ description: "If brewing fails, open an interactive debugging session with access to IRB " \
"or a shell inside the temporary build directory." "or a shell inside the temporary build directory."
switch "-f", "--force", switch "-f", "--force",
description: "Install formulae without checking for previously installed keg-only or "\ description: "Install formulae without checking for previously installed keg-only or " \
"non-migrated versions. Overwrite existing files when installing casks." "non-migrated versions. Overwrite existing files when installing casks."
switch "-v", "--verbose", switch "-v", "--verbose",
description: "Print the verification and postinstall steps." description: "Print the verification and postinstall steps."
[
[:switch, "--formula", "--formulae", {
description: "Treat all named arguments as formulae.",
}],
[:flag, "--env=", {
description: "If `std` is passed, use the standard build environment instead of superenv. If `super` is " \
"passed, use superenv even if the formula specifies the standard build environment.",
}],
[:switch, "--ignore-dependencies", {
description: "An unsupported Homebrew development flag to skip installing any dependencies of any kind. " \
"If the dependencies are not already present, the formula will have issues. If you're not " \
"developing Homebrew, consider adjusting your PATH rather than using this flag.",
}],
[:switch, "--only-dependencies", {
description: "Install the dependencies with specified options but do not install the " \
"formula itself.",
}],
[:flag, "--cc=", {
description: "Attempt to compile using the specified <compiler>, which should be the name of the " \
"compiler's executable, e.g. `gcc-7` for GCC 7. In order to use LLVM's clang, specify " \
"`llvm_clang`. To use the Apple-provided clang, specify `clang`. This option will only " \
"accept compilers that are provided by Homebrew or bundled with macOS. Please do not " \
"file issues if you encounter errors while using this option.",
}],
[:switch, "-s", "--build-from-source", {
description: "Compile <formula> from source even if a bottle is provided. " \
"Dependencies will still be installed from bottles if they are 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, "--include-test", {
description: "Install testing dependencies required to run `brew test` <formula>.",
}],
[:switch, "--HEAD", {
description: "If <formula> defines it, install the HEAD version, aka. master, trunk, unstable.",
}],
[: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 only be checked for " \
"updates when a new stable or development version has been released.",
}],
[:switch, "--keep-tmp", {
description: "Retain the temporary files created during installation.",
}],
[:switch, "--build-bottle", {
description: "Prepare the formula for eventual bottling during installation, skipping any " \
"post-install steps.",
}],
[:flag, "--bottle-arch=", {
depends_on: "--build-bottle",
description: "Optimise bottles for the specified architecture rather than the oldest " \
"architecture supported by the version of macOS the bottles are built on.",
}],
[:switch, "--display-times", {
env: :display_install_times,
description: "Print install times for each formula at the end of the run.",
}],
[:switch, "-i", "--interactive", {
description: "Download and patch <formula>, then open a shell. This allows the user to " \
"run `./configure --help` and otherwise determine how to turn the software " \
"package into a Homebrew package.",
}],
[:switch, "-g", "--git", {
description: "Create a Git repository, useful for creating patches to the software.",
}],
].each do |*args, **options|
send(*args, **options)
conflicts "--cask", args.last
end
formula_options
[
[:switch, "--cask", "--casks", { description: "Treat all named arguments as casks." }],
*Cask::Cmd::AbstractCommand::OPTIONS,
*Cask::Cmd::Install::OPTIONS,
].each do |*args, **options|
send(*args, **options)
conflicts "--formula", args.last
end
cask_options
conflicts "--ignore-dependencies", "--only-dependencies" conflicts "--ignore-dependencies", "--only-dependencies"
conflicts "--build-from-source", "--build-bottle", "--force-bottle" conflicts "--build-from-source", "--build-bottle", "--force-bottle"
formula_only_options.each do |options| min_named :formula_or_cask
send(*options)
conflicts "--cask", options[-2]
end
cask_only_options.each do |options|
send(*options)
conflicts "--formula", options[-2]
end
formula_options
min_named :formula
end end
end end

View File

@ -18,39 +18,61 @@ 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` [<options>] <formula> `reinstall` [<options>] <formula>|<cask>
Uninstall and then install <formula> using the same options it was originally Uninstall and then reinstall a <formula> or <cask> using the same options it was
installed with, plus any appended brew formula options. originally installed with, plus any appended options specific to a <formula>.
Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the
reinstalled formulae or, every 30 days, for all formulae. reinstalled formulae or, every 30 days, for all formulae.
EOS EOS
switch "-d", "--debug", switch "-d", "--debug",
description: "If brewing fails, open an interactive debugging session with access to IRB "\ description: "If brewing fails, open an interactive debugging session with access to IRB " \
"or a shell inside the temporary build directory." "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 "-i", "--interactive",
description: "Download and patch <formula>, then open a shell. This allows the user to "\
"run `./configure --help` and otherwise determine how to turn the software "\
"package into a Homebrew package."
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: "Retain the temporary files created during installation."
switch "-f", "--force", switch "-f", "--force",
description: "Install without checking for previously installed keg-only or "\ description: "Install without checking for previously installed keg-only or " \
"non-migrated versions." "non-migrated versions."
switch "-v", "--verbose", switch "-v", "--verbose",
description: "Print the verification and postinstall steps." description: "Print the verification and postinstall steps."
switch "--display-times", [
env: :display_install_times, [:switch, "--formula", "--formulae", { description: "Treat all named arguments as formulae." }],
description: "Print install times for each formula at the end of the run." [:switch, "-s", "--build-from-source", {
conflicts "--build-from-source", "--force-bottle" description: "Compile <formula> from source even if a bottle is available.",
}],
[:switch, "-i", "--interactive", {
description: "Download and patch <formula>, then open a shell. This allows the user to " \
"run `./configure --help` and otherwise determine how to turn the software " \
"package into a Homebrew package.",
}],
[: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: "Retain the temporary files created during installation.",
}],
[:switch, "--display-times", {
env: :display_install_times,
description: "Print install times for each formula at the end of the run.",
}],
].each do |options|
send(*options)
conflicts "--cask", options[-2]
end
formula_options formula_options
min_named :formula [
[:switch, "--cask", "--casks", { description: "Treat all named arguments as casks." }],
*Cask::Cmd::AbstractCommand::OPTIONS,
*Cask::Cmd::Install::OPTIONS,
].each do |options|
send(*options)
conflicts "--formula", options[-2]
end
cask_options
conflicts "--build-from-source", "--force-bottle"
min_named :formula_or_cask
end end
end end
@ -61,8 +83,13 @@ module Homebrew
Install.perform_preinstall_checks Install.perform_preinstall_checks
resolved_formulae, casks = args.named.to_resolved_formulae_to_casks only = :cask if args.cask? && !args.formula?
resolved_formulae.each do |f| only = :formula if !args.cask? && args.formula?
formulae, casks = args.named.to_formulae_and_casks(only: only, method: :resolve)
.partition { |o| o.is_a?(Formula) }
formulae.each do |f|
if f.pinned? if f.pinned?
onoe "#{f.full_name} is pinned. You must unpin it to reinstall." onoe "#{f.full_name} is pinned. You must unpin it to reinstall."
next next
@ -74,18 +101,18 @@ module Homebrew
Upgrade.check_installed_dependents(args: args) Upgrade.check_installed_dependents(args: args)
if casks.any?
Cask::Cmd::Reinstall.reinstall_casks(
*casks,
binaries: EnvConfig.cask_opts_binaries?,
verbose: args.verbose?,
force: args.force?,
require_sha: EnvConfig.cask_opts_require_sha?,
skip_cask_deps: args.skip_cask_deps?,
quarantine: EnvConfig.cask_opts_quarantine?,
)
end
Homebrew.messages.display_messages(display_times: args.display_times?) Homebrew.messages.display_messages(display_times: args.display_times?)
return if casks.blank?
Cask::Cmd::Reinstall.reinstall_casks(
*casks,
binaries: EnvConfig.cask_opts_binaries?,
verbose: args.verbose?,
force: args.force?,
require_sha: EnvConfig.cask_opts_require_sha?,
skip_cask_deps: args.skip_cask_deps?,
quarantine: EnvConfig.cask_opts_quarantine?,
)
end end
end end

View File

@ -26,47 +26,65 @@ module Homebrew
switch "-d", "--debug", switch "-d", "--debug",
description: "If brewing fails, open an interactive debugging session with access to IRB "\ description: "If brewing fails, open an interactive debugging session with access to IRB "\
"or a shell inside the temporary build directory." "or a shell inside the temporary build directory."
switch "--formula",
description: "Only upgrade outdated formulae."
switch "--cask",
description: "Only upgrade outdated casks."
switch "-s", "--build-from-source",
description: "Compile <formula> from source even if a bottle is available."
switch "-i", "--interactive",
description: "Download and patch <formula>, then open a shell. This allows the user to "\
"run `./configure --help` and otherwise determine how to turn the software "\
"package into a Homebrew package."
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 only be checked for "\
"updates when a new stable or development version has been released."
switch "--ignore-pinned",
description: "Set a successful exit status even if pinned formulae are not upgraded."
switch "--keep-tmp",
description: "Retain the temporary files created during installation."
switch "-f", "--force", switch "-f", "--force",
description: "Install without checking for previously installed keg-only or "\ description: "Install formulae without checking for previously installed keg-only or "\
"non-migrated versions." "non-migrated versions. Overwrite existing files when installing casks."
switch "-v", "--verbose", switch "-v", "--verbose",
description: "Print the verification and postinstall steps." description: "Print the verification and postinstall steps."
switch "--display-times",
env: :display_install_times,
description: "Print install times for each formula at the end of the run."
switch "-n", "--dry-run", switch "-n", "--dry-run",
description: "Show what would be upgraded, but do not actually upgrade anything." description: "Show what would be upgraded, but do not actually upgrade anything."
switch "--greedy", [
description: "Upgrade casks with `auto_updates` or `version :latest`" [:switch, "--formula", "--formulae", {
conflicts "--build-from-source", "--force-bottle" description: "Treat all named arguments as formulae. If no named arguments" \
conflicts "--formula", "--greedy" "are specified, upgrade only outdated formulae.",
["--formula", "-s", "--build-from-source", "-i", "--interactive", }],
"--force-bottle", "--fetch-HEAD", "--ignore-pinned", "--keep-tmp", [:switch, "-s", "--build-from-source", {
"--display-times"].each do |flag| description: "Compile <formula> from source even if a bottle is available.",
conflicts "--cask", flag }],
[:switch, "-i", "--interactive", {
description: "Download and patch <formula>, then open a shell. This allows the user to "\
"run `./configure --help` and otherwise determine how to turn the software "\
"package into a Homebrew package.",
}],
[: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 only be checked for "\
"updates when a new stable or development version has been released.",
}],
[:switch, "--ignore-pinned", {
description: "Set a successful exit status even if pinned formulae are not upgraded.",
}],
[:switch, "--keep-tmp", {
description: "Retain the temporary files created during installation.",
}],
[:switch, "--display-times", {
env: :display_install_times,
description: "Print install times for each formula at the end of the run.",
}],
].each do |options|
send(*options)
conflicts "--cask", options[-2]
end end
formula_options formula_options
[
[:switch, "--cask", "--casks", {
description: "Treat all named arguments as casks. If no named arguments " \
"are specified, upgrade only outdated casks.",
}],
*Cask::Cmd::AbstractCommand::OPTIONS,
*Cask::Cmd::Upgrade::OPTIONS,
].each do |options|
send(*options)
conflicts "--formula", options[-2]
end
cask_options
conflicts "--build-from-source", "--force-bottle"
end end
end end

View File

@ -66,6 +66,7 @@ module Homebrew
variables[:developer_commands] = generate_cmd_manpages(Commands.internal_developer_commands_paths) variables[:developer_commands] = generate_cmd_manpages(Commands.internal_developer_commands_paths)
variables[:official_external_commands] = variables[:official_external_commands] =
generate_cmd_manpages(Commands.official_external_commands_paths(quiet: quiet)) generate_cmd_manpages(Commands.official_external_commands_paths(quiet: quiet))
variables[:global_cask_options] = global_cask_options_manpage
variables[:global_options] = global_options_manpage variables[:global_options] = global_options_manpage
variables[:environment_variables] = env_vars_manpage variables[:environment_variables] = env_vars_manpage
@ -171,7 +172,12 @@ module Homebrew
def cmd_parser_manpage_lines(cmd_parser) def cmd_parser_manpage_lines(cmd_parser)
lines = [format_usage_banner(cmd_parser.usage_banner_text)] lines = [format_usage_banner(cmd_parser.usage_banner_text)]
lines += cmd_parser.processed_options.map do |short, long, _, desc| lines += cmd_parser.processed_options.map do |short, long, _, desc|
next if !long.nil? && Homebrew::CLI::Parser.global_options.include?([short, long, desc]) if long.present?
next if Homebrew::CLI::Parser.global_options.include?([short, long, desc])
next if Homebrew::CLI::Parser.global_cask_options.any? do |_, option, description:, **|
[long, "#{long}="].include?(option) && description == desc
end
end
generate_option_doc(short, long, desc) generate_option_doc(short, long, desc)
end.reject(&:blank?) end.reject(&:blank?)
@ -203,6 +209,14 @@ module Homebrew
lines lines
end end
def global_cask_options_manpage
lines = ["These options are applicable to subcommands accepting a `--cask` flag and all `cask` commands.\n"]
lines += Homebrew::CLI::Parser.global_cask_options.map do |_, long, description:, **|
generate_option_doc(nil, long, description)
end
lines.join("\n")
end
def global_options_manpage def global_options_manpage
lines = ["These options are applicable across multiple subcommands.\n"] lines = ["These options are applicable across multiple subcommands.\n"]
lines += Homebrew::CLI::Parser.global_options.map do |short, long, desc| lines += Homebrew::CLI::Parser.global_options.map do |short, long, desc|

View File

@ -27,6 +27,13 @@ class FormulaUnspecifiedError < UsageError
end end
end end
# Raised when a command expects a formula or cask and none was specified.
class FormulaOrCaskUnspecifiedError < UsageError
def initialize
super "this command requires a formula or cask argument"
end
end
# Raised when a command expects a keg and none was specified. # Raised when a command expects a keg and none was specified.
class KegUnspecifiedError < UsageError class KegUnspecifiedError < UsageError
def initialize def initialize

View File

@ -1 +0,0 @@

View File

@ -59,6 +59,10 @@ If no search term is provided, all locally available formulae are listed.
<%= developer_commands %> <%= developer_commands %>
## GLOBAL CASK OPTIONS
<%= global_cask_options %>
## GLOBAL OPTIONS ## GLOBAL OPTIONS
<%= global_options %> <%= global_options %>

View File

@ -118,37 +118,6 @@ Commands:
See also: `man brew` See also: `man brew`
* `--appdir`:
Target location for Applications. Default: `/Applications`
* `--colorpickerdir`:
Target location for Color Pickers. Default: `~/Library/ColorPickers`
* `--prefpanedir`:
Target location for Preference Panes. Default: `~/Library/PreferencePanes`
* `--qlplugindir`:
Target location for QuickLook Plugins. Default: `~/Library/QuickLook`
* `--mdimporterdir`:
Target location for Spotlight Plugins. Default: `~/Library/Spotlight`
* `--dictionarydir`:
Target location for Dictionaries. Default: `~/Library/Dictionaries`
* `--fontdir`:
Target location for Fonts. Default: `~/Library/Fonts`
* `--servicedir`:
Target location for Services. Default: `~/Library/Services`
* `--input_methoddir`:
Target location for Input Methods. Default: `~/Library/Input Methods`
* `--internet_plugindir`:
Target location for Internet Plugins. Default: `~/Library/Internet Plug-Ins`
* `--audio_unit_plugindir`:
Target location for Audio Unit Plugins. Default: `~/Library/Audio/Plug-Ins/Components`
* `--vst_plugindir`:
Target location for VST Plugins. Default: `~/Library/Audio/Plug-Ins/VST`
* `--vst3_plugindir`:
Target location for VST3 Plugins. Default: `~/Library/Audio/Plug-Ins/VST3`
* `--screen_saverdir`:
Target location for Screen Savers. Default: `~/Library/Screen Savers`
* `--language`:
Set language of the Cask to install. The first matching language is used, otherwise the default language on the Cask. The default value is the `language of your system`
### `cleanup` [*`options`*] [*`formula`*|*`cask`*] ### `cleanup` [*`options`*] [*`formula`*|*`cask`*]
Remove stale lock files and outdated downloads for all formulae and casks, Remove stale lock files and outdated downloads for all formulae and casks,
@ -304,12 +273,13 @@ If *`formula`* is provided, show summary of information about *`formula`*.
* `-v`, `--verbose`: * `-v`, `--verbose`:
Show more verbose analytics data for *`formula`*. Show more verbose analytics data for *`formula`*.
### `install` [*`options`*] *`formula`* ### `install` [*`options`*] *`formula`*|*`cask`*
Install *`formula`*. Additional options specific to *`formula`* may be appended to the command. Install a *`formula`* or *`cask`*. Additional options specific to a *`formula`* may be
appended to the command.
Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for
installed formulae or, every 30 days, for all formulae. the installed formulae or, every 30 days, for all formulae.
* `-d`, `--debug`: * `-d`, `--debug`:
If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory. If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory.
@ -351,36 +321,6 @@ installed formulae or, every 30 days, for all formulae.
Create a Git repository, useful for creating patches to the software. Create a Git repository, useful for creating patches to the software.
* `--cask`: * `--cask`:
Treat all named arguments as casks. Treat all named arguments as casks.
* `--appdir`:
Target location for Applications. Default: `/Applications`
* `--colorpickerdir`:
Target location for Color Pickers. Default: `~/Library/ColorPickers`
* `--prefpanedir`:
Target location for Preference Panes. Default: `~/Library/PreferencePanes`
* `--qlplugindir`:
Target location for QuickLook Plugins. Default: `~/Library/QuickLook`
* `--mdimporterdir`:
Target location for Spotlight Plugins. Default: `~/Library/Spotlight`
* `--dictionarydir`:
Target location for Dictionaries. Default: `~/Library/Dictionaries`
* `--fontdir`:
Target location for Fonts. Default: `~/Library/Fonts`
* `--servicedir`:
Target location for Services. Default: `~/Library/Services`
* `--input_methoddir`:
Target location for Input Methods. Default: `~/Library/Input Methods`
* `--internet_plugindir`:
Target location for Internet Plugins. Default: `~/Library/Internet Plug-Ins`
* `--audio_unit_plugindir`:
Target location for Audio Unit Plugins. Default: `~/Library/Audio/Plug-Ins/Components`
* `--vst_plugindir`:
Target location for VST Plugins. Default: `~/Library/Audio/Plug-Ins/VST`
* `--vst3_plugindir`:
Target location for VST3 Plugins. Default: `~/Library/Audio/Plug-Ins/VST3`
* `--screen_saverdir`:
Target location for Screen Savers. Default: `~/Library/Screen Savers`
* `--language`:
Set language of the Cask to install. The first matching language is used, otherwise the default language on the Cask. The default value is the `language of your system`
* `--[no-]binaries`: * `--[no-]binaries`:
Disable/enable linking of helper executables. Default: enabled Disable/enable linking of helper executables. Default: enabled
* `--require-sha`: * `--require-sha`:
@ -523,16 +463,22 @@ all items or checking if any current formulae/casks have Ruby issues.
* `--syntax`: * `--syntax`:
Syntax-check all of Homebrew's Ruby files (if no `*`tap`*` is passed). Syntax-check all of Homebrew's Ruby files (if no `*`tap`*` is passed).
### `reinstall` [*`options`*] *`formula`* ### `reinstall` [*`options`*] *`formula`*|*`cask`*
Uninstall and then install *`formula`* using the same options it was originally Uninstall and then reinstall a *`formula`* or *`cask`* using the same options it was
installed with, plus any appended brew formula options. originally installed with, plus any appended options specific to a *`formula`*.
Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the
reinstalled formulae or, every 30 days, for all formulae. reinstalled formulae or, every 30 days, for all formulae.
* `-d`, `--debug`: * `-d`, `--debug`:
If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory. If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory.
* `-f`, `--force`:
Install without checking for previously installed keg-only or non-migrated versions.
* `-v`, `--verbose`:
Print the verification and postinstall steps.
* `--formula`:
Treat all named arguments as formulae.
* `-s`, `--build-from-source`: * `-s`, `--build-from-source`:
Compile *`formula`* from source even if a bottle is available. Compile *`formula`* from source even if a bottle is available.
* `-i`, `--interactive`: * `-i`, `--interactive`:
@ -541,12 +487,18 @@ reinstalled formulae or, every 30 days, for all formulae.
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. 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.
* `--keep-tmp`: * `--keep-tmp`:
Retain the temporary files created during installation. Retain the temporary files created during installation.
* `-f`, `--force`:
Install without checking for previously installed keg-only or non-migrated versions.
* `-v`, `--verbose`:
Print the verification and postinstall steps.
* `--display-times`: * `--display-times`:
Print install times for each formula at the end of the run. Print install times for each formula at the end of the run.
* `--cask`:
Treat all named arguments as casks.
* `--[no-]binaries`:
Disable/enable linking of helper executables. Default: enabled
* `--require-sha`:
Require all casks to have a checksum.
* `--[no-]quarantine`:
Disable/enable quarantining of downloads. Default: enabled
* `--skip-cask-deps`:
Skip installing cask dependencies.
### `search` [*`options`*] [*`text`*|`/`*`text`*`/`] ### `search` [*`options`*] [*`text`*|`/`*`text`*`/`]
@ -680,10 +632,14 @@ upgraded formulae or, every 30 days, for all formulae.
* `-d`, `--debug`: * `-d`, `--debug`:
If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory. If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory.
* `-f`, `--force`:
Install formulae without checking for previously installed keg-only or non-migrated versions. Overwrite existing files when installing casks.
* `-v`, `--verbose`:
Print the verification and postinstall steps.
* `-n`, `--dry-run`:
Show what would be upgraded, but do not actually upgrade anything.
* `--formula`: * `--formula`:
Only upgrade outdated formulae. Treat all named arguments as formulae. If no named argumentsare specified, upgrade only outdated formulae.
* `--cask`:
Only upgrade outdated casks.
* `-s`, `--build-from-source`: * `-s`, `--build-from-source`:
Compile *`formula`* from source even if a bottle is available. Compile *`formula`* from source even if a bottle is available.
* `-i`, `--interactive`: * `-i`, `--interactive`:
@ -696,16 +652,20 @@ upgraded formulae or, every 30 days, for all formulae.
Set a successful exit status even if pinned formulae are not upgraded. Set a successful exit status even if pinned formulae are not upgraded.
* `--keep-tmp`: * `--keep-tmp`:
Retain the temporary files created during installation. Retain the temporary files created during installation.
* `-f`, `--force`:
Install without checking for previously installed keg-only or non-migrated versions.
* `-v`, `--verbose`:
Print the verification and postinstall steps.
* `--display-times`: * `--display-times`:
Print install times for each formula at the end of the run. Print install times for each formula at the end of the run.
* `-n`, `--dry-run`: * `--cask`:
Show what would be upgraded, but do not actually upgrade anything. Treat all named arguments as casks. If no named arguments are specified, upgrade only outdated casks.
* `--[no-]binaries`:
Disable/enable linking of helper executables. Default: enabled
* `--require-sha`:
Require all casks to have a checksum.
* `--[no-]quarantine`:
Disable/enable quarantining of downloads. Default: enabled
* `--skip-cask-deps`:
Skip installing cask dependencies.
* `--greedy`: * `--greedy`:
Upgrade casks with `auto_updates` or `version :latest` Also include casks with `auto_updates true` or `version :latest`.
### `uses` [*`options`*] *`formula`* ### `uses` [*`options`*] *`formula`*
@ -1360,6 +1320,55 @@ If no options are passed, use `origin/master` as the start commit.
Install and commit Homebrew's vendored gems. Install and commit Homebrew's vendored gems.
## GLOBAL CASK OPTIONS
These options are applicable to subcommands accepting a `--cask` flag and all `cask` commands.
* `--appdir=`:
Target location for Applications. Default: `/Applications`
* `--colorpickerdir=`:
Target location for Color Pickers. Default: `~/Library/ColorPickers`
* `--prefpanedir=`:
Target location for Preference Panes. Default: `~/Library/PreferencePanes`
* `--qlplugindir=`:
Target location for QuickLook Plugins. Default: `~/Library/QuickLook`
* `--mdimporterdir=`:
Target location for Spotlight Plugins. Default: `~/Library/Spotlight`
* `--dictionarydir=`:
Target location for Dictionaries. Default: `~/Library/Dictionaries`
* `--fontdir=`:
Target location for Fonts. Default: `~/Library/Fonts`
* `--servicedir=`:
Target location for Services. Default: `~/Library/Services`
* `--input_methoddir=`:
Target location for Input Methods. Default: `~/Library/Input Methods`
* `--internet_plugindir=`:
Target location for Internet Plugins. Default: `~/Library/Internet Plug-Ins`
* `--audio_unit_plugindir=`:
Target location for Audio Unit Plugins. Default: `~/Library/Audio/Plug-Ins/Components`
* `--vst_plugindir=`:
Target location for VST Plugins. Default: `~/Library/Audio/Plug-Ins/VST`
* `--vst3_plugindir=`:
Target location for VST3 Plugins. Default: `~/Library/Audio/Plug-Ins/VST3`
* `--screen_saverdir=`:
Target location for Screen Savers. Default: `~/Library/Screen Savers`
* `--language`:
Set language of the Cask to install. The first matching language is used, otherwise the default language on the Cask. The default value is the `language of your system`
## GLOBAL OPTIONS ## GLOBAL OPTIONS
These options are applicable across multiple subcommands. These options are applicable across multiple subcommands.
@ -1859,6 +1868,7 @@ See our issues on GitHub:
[ESSENTIAL COMMANDS]: #ESSENTIAL-COMMANDS "ESSENTIAL COMMANDS" [ESSENTIAL COMMANDS]: #ESSENTIAL-COMMANDS "ESSENTIAL COMMANDS"
[COMMANDS]: #COMMANDS "COMMANDS" [COMMANDS]: #COMMANDS "COMMANDS"
[DEVELOPER COMMANDS]: #DEVELOPER-COMMANDS "DEVELOPER COMMANDS" [DEVELOPER COMMANDS]: #DEVELOPER-COMMANDS "DEVELOPER COMMANDS"
[GLOBAL CASK OPTIONS]: #GLOBAL-CASK-OPTIONS "GLOBAL CASK OPTIONS"
[GLOBAL OPTIONS]: #GLOBAL-OPTIONS "GLOBAL OPTIONS" [GLOBAL OPTIONS]: #GLOBAL-OPTIONS "GLOBAL OPTIONS"
[OFFICIAL EXTERNAL COMMANDS]: #OFFICIAL-EXTERNAL-COMMANDS "OFFICIAL EXTERNAL COMMANDS" [OFFICIAL EXTERNAL COMMANDS]: #OFFICIAL-EXTERNAL-COMMANDS "OFFICIAL EXTERNAL COMMANDS"
[CUSTOM EXTERNAL COMMANDS]: #CUSTOM-EXTERNAL-COMMANDS "CUSTOM EXTERNAL COMMANDS" [CUSTOM EXTERNAL COMMANDS]: #CUSTOM-EXTERNAL-COMMANDS "CUSTOM EXTERNAL COMMANDS"

View File

@ -172,66 +172,6 @@ Zaps all files associated with the given \fIcask\fR
.P .P
See also: \fBman brew\fR See also: \fBman brew\fR
. .
.TP
\fB\-\-appdir\fR
Target location for Applications\. Default: \fB/Applications\fR
.
.TP
\fB\-\-colorpickerdir\fR
Target location for Color Pickers\. Default: \fB~/Library/ColorPickers\fR
.
.TP
\fB\-\-prefpanedir\fR
Target location for Preference Panes\. Default: \fB~/Library/PreferencePanes\fR
.
.TP
\fB\-\-qlplugindir\fR
Target location for QuickLook Plugins\. Default: \fB~/Library/QuickLook\fR
.
.TP
\fB\-\-mdimporterdir\fR
Target location for Spotlight Plugins\. Default: \fB~/Library/Spotlight\fR
.
.TP
\fB\-\-dictionarydir\fR
Target location for Dictionaries\. Default: \fB~/Library/Dictionaries\fR
.
.TP
\fB\-\-fontdir\fR
Target location for Fonts\. Default: \fB~/Library/Fonts\fR
.
.TP
\fB\-\-servicedir\fR
Target location for Services\. Default: \fB~/Library/Services\fR
.
.TP
\fB\-\-input_methoddir\fR
Target location for Input Methods\. Default: \fB~/Library/Input Methods\fR
.
.TP
\fB\-\-internet_plugindir\fR
Target location for Internet Plugins\. Default: \fB~/Library/Internet Plug\-Ins\fR
.
.TP
\fB\-\-audio_unit_plugindir\fR
Target location for Audio Unit Plugins\. Default: \fB~/Library/Audio/Plug\-Ins/Components\fR
.
.TP
\fB\-\-vst_plugindir\fR
Target location for VST Plugins\. Default: \fB~/Library/Audio/Plug\-Ins/VST\fR
.
.TP
\fB\-\-vst3_plugindir\fR
Target location for VST3 Plugins\. Default: \fB~/Library/Audio/Plug\-Ins/VST3\fR
.
.TP
\fB\-\-screen_saverdir\fR
Target location for Screen Savers\. Default: \fB~/Library/Screen Savers\fR
.
.TP
\fB\-\-language\fR
Set language of the Cask to install\. The first matching language is used, otherwise the default language on the Cask\. The default value is the \fBlanguage of your system\fR
.
.SS "\fBcleanup\fR [\fIoptions\fR] [\fIformula\fR|\fIcask\fR]" .SS "\fBcleanup\fR [\fIoptions\fR] [\fIformula\fR|\fIcask\fR]"
Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae\. If arguments are specified, only do this for the given formulae and casks\. Removes all downloads more than 120 days old\. This can be adjusted with \fBHOMEBREW_CLEANUP_MAX_AGE_DAYS\fR\. Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae\. If arguments are specified, only do this for the given formulae and casks\. Removes all downloads more than 120 days old\. This can be adjusted with \fBHOMEBREW_CLEANUP_MAX_AGE_DAYS\fR\.
. .
@ -445,8 +385,8 @@ Print JSON of all available formulae\.
\fB\-v\fR, \fB\-\-verbose\fR \fB\-v\fR, \fB\-\-verbose\fR
Show more verbose analytics data for \fIformula\fR\. Show more verbose analytics data for \fIformula\fR\.
. .
.SS "\fBinstall\fR [\fIoptions\fR] \fIformula\fR" .SS "\fBinstall\fR [\fIoptions\fR] \fIformula\fR|\fIcask\fR"
Install \fIformula\fR\. Additional options specific to \fIformula\fR may be appended to the command\. Install a \fIformula\fR or \fIcask\fR\. Additional options specific to a \fIformula\fR may be appended to the command\.
. .
.P .P
Unless \fBHOMEBREW_NO_INSTALL_CLEANUP\fR is set, \fBbrew cleanup\fR will then be run for the installed formulae or, every 30 days, for all formulae\. Unless \fBHOMEBREW_NO_INSTALL_CLEANUP\fR is set, \fBbrew cleanup\fR will then be run for the installed formulae or, every 30 days, for all formulae\.
@ -532,66 +472,6 @@ Create a Git repository, useful for creating patches to the software\.
Treat all named arguments as casks\. Treat all named arguments as casks\.
. .
.TP .TP
\fB\-\-appdir\fR
Target location for Applications\. Default: \fB/Applications\fR
.
.TP
\fB\-\-colorpickerdir\fR
Target location for Color Pickers\. Default: \fB~/Library/ColorPickers\fR
.
.TP
\fB\-\-prefpanedir\fR
Target location for Preference Panes\. Default: \fB~/Library/PreferencePanes\fR
.
.TP
\fB\-\-qlplugindir\fR
Target location for QuickLook Plugins\. Default: \fB~/Library/QuickLook\fR
.
.TP
\fB\-\-mdimporterdir\fR
Target location for Spotlight Plugins\. Default: \fB~/Library/Spotlight\fR
.
.TP
\fB\-\-dictionarydir\fR
Target location for Dictionaries\. Default: \fB~/Library/Dictionaries\fR
.
.TP
\fB\-\-fontdir\fR
Target location for Fonts\. Default: \fB~/Library/Fonts\fR
.
.TP
\fB\-\-servicedir\fR
Target location for Services\. Default: \fB~/Library/Services\fR
.
.TP
\fB\-\-input_methoddir\fR
Target location for Input Methods\. Default: \fB~/Library/Input Methods\fR
.
.TP
\fB\-\-internet_plugindir\fR
Target location for Internet Plugins\. Default: \fB~/Library/Internet Plug\-Ins\fR
.
.TP
\fB\-\-audio_unit_plugindir\fR
Target location for Audio Unit Plugins\. Default: \fB~/Library/Audio/Plug\-Ins/Components\fR
.
.TP
\fB\-\-vst_plugindir\fR
Target location for VST Plugins\. Default: \fB~/Library/Audio/Plug\-Ins/VST\fR
.
.TP
\fB\-\-vst3_plugindir\fR
Target location for VST3 Plugins\. Default: \fB~/Library/Audio/Plug\-Ins/VST3\fR
.
.TP
\fB\-\-screen_saverdir\fR
Target location for Screen Savers\. Default: \fB~/Library/Screen Savers\fR
.
.TP
\fB\-\-language\fR
Set language of the Cask to install\. The first matching language is used, otherwise the default language on the Cask\. The default value is the \fBlanguage of your system\fR
.
.TP
\fB\-\-[no\-]binaries\fR \fB\-\-[no\-]binaries\fR
Disable/enable linking of helper executables\. Default: enabled Disable/enable linking of helper executables\. Default: enabled
. .
@ -779,8 +659,8 @@ Verify any alias symlinks in each tap\.
\fB\-\-syntax\fR \fB\-\-syntax\fR
Syntax\-check all of Homebrew\'s Ruby files (if no \fB<tap>\fR is passed)\. Syntax\-check all of Homebrew\'s Ruby files (if no \fB<tap>\fR is passed)\.
. .
.SS "\fBreinstall\fR [\fIoptions\fR] \fIformula\fR" .SS "\fBreinstall\fR [\fIoptions\fR] \fIformula\fR|\fIcask\fR"
Uninstall and then install \fIformula\fR using the same options it was originally installed with, plus any appended brew formula options\. Uninstall and then reinstall a \fIformula\fR or \fIcask\fR using the same options it was originally installed with, plus any appended options specific to a \fIformula\fR\.
. .
.P .P
Unless \fBHOMEBREW_NO_INSTALL_CLEANUP\fR is set, \fBbrew cleanup\fR will then be run for the reinstalled formulae or, every 30 days, for all formulae\. Unless \fBHOMEBREW_NO_INSTALL_CLEANUP\fR is set, \fBbrew cleanup\fR will then be run for the reinstalled formulae or, every 30 days, for all formulae\.
@ -790,6 +670,18 @@ Unless \fBHOMEBREW_NO_INSTALL_CLEANUP\fR is set, \fBbrew cleanup\fR will then be
If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory\. If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory\.
. .
.TP .TP
\fB\-f\fR, \fB\-\-force\fR
Install without checking for previously installed keg\-only or non\-migrated versions\.
.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Print the verification and postinstall steps\.
.
.TP
\fB\-\-formula\fR
Treat all named arguments as formulae\.
.
.TP
\fB\-s\fR, \fB\-\-build\-from\-source\fR \fB\-s\fR, \fB\-\-build\-from\-source\fR
Compile \fIformula\fR from source even if a bottle is available\. Compile \fIformula\fR from source even if a bottle is available\.
. .
@ -806,17 +698,29 @@ Install from a bottle if it exists for the current or newest version of macOS, e
Retain the temporary files created during installation\. Retain the temporary files created during installation\.
. .
.TP .TP
\fB\-f\fR, \fB\-\-force\fR
Install without checking for previously installed keg\-only or non\-migrated versions\.
.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Print the verification and postinstall steps\.
.
.TP
\fB\-\-display\-times\fR \fB\-\-display\-times\fR
Print install times for each formula at the end of the run\. Print install times for each formula at the end of the run\.
. .
.TP
\fB\-\-cask\fR
Treat all named arguments as casks\.
.
.TP
\fB\-\-[no\-]binaries\fR
Disable/enable linking of helper executables\. Default: enabled
.
.TP
\fB\-\-require\-sha\fR
Require all casks to have a checksum\.
.
.TP
\fB\-\-[no\-]quarantine\fR
Disable/enable quarantining of downloads\. Default: enabled
.
.TP
\fB\-\-skip\-cask\-deps\fR
Skip installing cask dependencies\.
.
.SS "\fBsearch\fR [\fIoptions\fR] [\fItext\fR|\fB/\fR\fItext\fR\fB/\fR]" .SS "\fBsearch\fR [\fIoptions\fR] [\fItext\fR|\fB/\fR\fItext\fR\fB/\fR]"
Perform a substring search of cask tokens and formula names for \fItext\fR\. If \fItext\fR is flanked by slashes, it is interpreted as a regular expression\. The search for \fItext\fR is extended online to \fBhomebrew/core\fR and \fBhomebrew/cask\fR\. Perform a substring search of cask tokens and formula names for \fItext\fR\. If \fItext\fR is flanked by slashes, it is interpreted as a regular expression\. The search for \fItext\fR is extended online to \fBhomebrew/core\fR and \fBhomebrew/cask\fR\.
. .
@ -970,12 +874,20 @@ Unless \fBHOMEBREW_NO_INSTALL_CLEANUP\fR is set, \fBbrew cleanup\fR will then be
If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory\. If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory\.
. .
.TP .TP
\fB\-\-formula\fR \fB\-f\fR, \fB\-\-force\fR
Only upgrade outdated formulae\. Install formulae without checking for previously installed keg\-only or non\-migrated versions\. Overwrite existing files when installing casks\.
. .
.TP .TP
\fB\-\-cask\fR \fB\-v\fR, \fB\-\-verbose\fR
Only upgrade outdated casks\. Print the verification and postinstall steps\.
.
.TP
\fB\-n\fR, \fB\-\-dry\-run\fR
Show what would be upgraded, but do not actually upgrade anything\.
.
.TP
\fB\-\-formula\fR
Treat all named arguments as formulae\. If no named argumentsare specified, upgrade only outdated formulae\.
. .
.TP .TP
\fB\-s\fR, \fB\-\-build\-from\-source\fR \fB\-s\fR, \fB\-\-build\-from\-source\fR
@ -1002,24 +914,32 @@ Set a successful exit status even if pinned formulae are not upgraded\.
Retain the temporary files created during installation\. Retain the temporary files created during installation\.
. .
.TP .TP
\fB\-f\fR, \fB\-\-force\fR
Install without checking for previously installed keg\-only or non\-migrated versions\.
.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Print the verification and postinstall steps\.
.
.TP
\fB\-\-display\-times\fR \fB\-\-display\-times\fR
Print install times for each formula at the end of the run\. Print install times for each formula at the end of the run\.
. .
.TP .TP
\fB\-n\fR, \fB\-\-dry\-run\fR \fB\-\-cask\fR
Show what would be upgraded, but do not actually upgrade anything\. Treat all named arguments as casks\. If no named arguments are specified, upgrade only outdated casks\.
.
.TP
\fB\-\-[no\-]binaries\fR
Disable/enable linking of helper executables\. Default: enabled
.
.TP
\fB\-\-require\-sha\fR
Require all casks to have a checksum\.
.
.TP
\fB\-\-[no\-]quarantine\fR
Disable/enable quarantining of downloads\. Default: enabled
.
.TP
\fB\-\-skip\-cask\-deps\fR
Skip installing cask dependencies\.
. .
.TP .TP
\fB\-\-greedy\fR \fB\-\-greedy\fR
Upgrade casks with \fBauto_updates\fR or \fBversion :latest\fR Also include casks with \fBauto_updates true\fR or \fBversion :latest\fR\.
. .
.SS "\fBuses\fR [\fIoptions\fR] \fIformula\fR" .SS "\fBuses\fR [\fIoptions\fR] \fIformula\fR"
Show formulae that specify \fIformula\fR as a dependency (i\.e\. show dependents of \fIformula\fR)\. When given multiple formula arguments, show the intersection of formulae that use \fIformula\fR\. By default, \fBuses\fR shows all formulae that specify \fIformula\fR as a required or recommended dependency for their stable builds\. Show formulae that specify \fIformula\fR as a dependency (i\.e\. show dependents of \fIformula\fR)\. When given multiple formula arguments, show the intersection of formulae that use \fIformula\fR\. By default, \fBuses\fR shows all formulae that specify \fIformula\fR as a required or recommended dependency for their stable builds\.
@ -1908,6 +1828,69 @@ Use the commit at the specified \fIdate\fR as the start commit\.
.SS "\fBvendor\-gems\fR" .SS "\fBvendor\-gems\fR"
Install and commit Homebrew\'s vendored gems\. Install and commit Homebrew\'s vendored gems\.
. .
.SH "GLOBAL CASK OPTIONS"
These options are applicable to subcommands accepting a \fB\-\-cask\fR flag and all \fBcask\fR commands\.
.
.TP
\fB\-\-appdir=\fR
Target location for Applications\. Default: \fB/Applications\fR
.
.TP
\fB\-\-colorpickerdir=\fR
Target location for Color Pickers\. Default: \fB~/Library/ColorPickers\fR
.
.TP
\fB\-\-prefpanedir=\fR
Target location for Preference Panes\. Default: \fB~/Library/PreferencePanes\fR
.
.TP
\fB\-\-qlplugindir=\fR
Target location for QuickLook Plugins\. Default: \fB~/Library/QuickLook\fR
.
.TP
\fB\-\-mdimporterdir=\fR
Target location for Spotlight Plugins\. Default: \fB~/Library/Spotlight\fR
.
.TP
\fB\-\-dictionarydir=\fR
Target location for Dictionaries\. Default: \fB~/Library/Dictionaries\fR
.
.TP
\fB\-\-fontdir=\fR
Target location for Fonts\. Default: \fB~/Library/Fonts\fR
.
.TP
\fB\-\-servicedir=\fR
Target location for Services\. Default: \fB~/Library/Services\fR
.
.TP
\fB\-\-input_methoddir=\fR
Target location for Input Methods\. Default: \fB~/Library/Input Methods\fR
.
.TP
\fB\-\-internet_plugindir=\fR
Target location for Internet Plugins\. Default: \fB~/Library/Internet Plug\-Ins\fR
.
.TP
\fB\-\-audio_unit_plugindir=\fR
Target location for Audio Unit Plugins\. Default: \fB~/Library/Audio/Plug\-Ins/Components\fR
.
.TP
\fB\-\-vst_plugindir=\fR
Target location for VST Plugins\. Default: \fB~/Library/Audio/Plug\-Ins/VST\fR
.
.TP
\fB\-\-vst3_plugindir=\fR
Target location for VST3 Plugins\. Default: \fB~/Library/Audio/Plug\-Ins/VST3\fR
.
.TP
\fB\-\-screen_saverdir=\fR
Target location for Screen Savers\. Default: \fB~/Library/Screen Savers\fR
.
.TP
\fB\-\-language\fR
Set language of the Cask to install\. The first matching language is used, otherwise the default language on the Cask\. The default value is the \fBlanguage of your system\fR
.
.SH "GLOBAL OPTIONS" .SH "GLOBAL OPTIONS"
These options are applicable across multiple subcommands\. These options are applicable across multiple subcommands\.
. .