diff --git a/Library/Homebrew/bundle/extensions/extension.rb b/Library/Homebrew/bundle/extensions/extension.rb index fb7c572e0a5c0..f72cda9c72dfe 100644 --- a/Library/Homebrew/bundle/extensions/extension.rb +++ b/Library/Homebrew/bundle/extensions/extension.rb @@ -33,13 +33,9 @@ def self.banner_name T.cast(const_get(:BANNER_NAME), String) end - sig { returns(String) } - def self.switch_description - if cleanup_supported? - "`list`, `dump` or `cleanup` #{banner_name}." - else - "`list` or `dump` #{banner_name}." - end + sig { params(description: String).returns(String) } + def self.switch_description(description) + description end sig { params(name: String, options: Homebrew::Bundle::EntryInputOptions).returns(Dsl::Entry) } diff --git a/Library/Homebrew/bundle/extensions/flatpak.rb b/Library/Homebrew/bundle/extensions/flatpak.rb index 03299756bea31..208b0ee47d34e 100644 --- a/Library/Homebrew/bundle/extensions/flatpak.rb +++ b/Library/Homebrew/bundle/extensions/flatpak.rb @@ -13,8 +13,8 @@ class Flatpak < Extension BANNER_NAME = "Flatpak packages" class << self - sig { override.returns(String) } - def switch_description + sig { override.params(description: String).returns(String) } + def switch_description(description) "#{super} Note: Linux only." end diff --git a/Library/Homebrew/bundle/subcommand/add.rb b/Library/Homebrew/bundle/subcommand/add.rb index 4f2c9419c82c4..d1087dbac1c17 100644 --- a/Library/Homebrew/bundle/subcommand/add.rb +++ b/Library/Homebrew/bundle/subcommand/add.rb @@ -17,7 +17,7 @@ class AddSubcommand < Homebrew::AbstractSubcommand EOS named_args min: 1 switch "--install", - description: "Run `install` before continuing to other operations, e.g. `exec`." + description: "Run `install` before adding entries." switch "--formula", "--formulae", "--brews", description: "Add Homebrew formula entries." switch "--cask", "--casks", @@ -26,10 +26,10 @@ class AddSubcommand < Homebrew::AbstractSubcommand description: "Add Homebrew tap entries." extensions.select(&:add_supported?).each do |extension| switch "--#{extension.flag}", - description: extension.switch_description + description: extension.switch_description("Add entries for #{extension.banner_name}.") end switch "--describe", - description: "`dump` and `add` add a description comment above each line, unless the " \ + description: "Add a description comment above each line, unless the " \ "dependency does not have a description.", env: :bundle_describe end diff --git a/Library/Homebrew/bundle/subcommand/check.rb b/Library/Homebrew/bundle/subcommand/check.rb index 288ecddae30c4..72fb3232ba40f 100644 --- a/Library/Homebrew/bundle/subcommand/check.rb +++ b/Library/Homebrew/bundle/subcommand/check.rb @@ -17,15 +17,13 @@ class CheckSubcommand < Homebrew::AbstractSubcommand EOS named_args :none switch "-v", "--verbose", - description: "`install` prints output from commands as they are run. " \ - "`check` lists all missing dependencies." + description: "List all missing dependencies." switch "--no-upgrade", - description: "`install` does not run `brew upgrade` on outdated dependencies. " \ - "`check` does not check for outdated dependencies. " \ + description: "Do not check for outdated dependencies. " \ "Note they may still be upgraded by `brew install` if needed.", env: :bundle_no_upgrade switch "--install", - description: "Run `install` before continuing to other operations, e.g. `exec`." + description: "Run `install` before checking dependencies." end sig { override.void } diff --git a/Library/Homebrew/bundle/subcommand/cleanup.rb b/Library/Homebrew/bundle/subcommand/cleanup.rb index b4f528f4347f5..8009274460735 100644 --- a/Library/Homebrew/bundle/subcommand/cleanup.rb +++ b/Library/Homebrew/bundle/subcommand/cleanup.rb @@ -23,23 +23,21 @@ class CleanupSubcommand < Homebrew::AbstractSubcommand EOS named_args :none switch "--install", - description: "Run `install` before continuing to other operations, e.g. `exec`." + description: "Run `install` before cleaning up dependencies." switch "-f", "--force", - description: "`install` runs with `--force`/`--overwrite`. " \ - "`dump` overwrites an existing `Brewfile`. " \ - "`cleanup` actually performs its cleanup operations." + description: "Actually perform cleanup operations." switch "--formula", "--formulae", "--brews", - description: "`list`, `dump` or `cleanup` Homebrew formula dependencies." + description: "Clean up Homebrew formula dependencies." switch "--cask", "--casks", - description: "`list`, `dump` or `cleanup` Homebrew cask dependencies." + description: "Clean up Homebrew cask dependencies." switch "--tap", "--taps", - description: "`list`, `dump` or `cleanup` Homebrew tap dependencies." + description: "Clean up Homebrew tap dependencies." Homebrew::Bundle.extensions.select(&:cleanup_supported?).each do |extension| switch "--#{extension.flag}", - description: extension.switch_description + description: extension.switch_description("Clean up #{extension.banner_name}.") end switch "--zap", - description: "`cleanup` casks using the `zap` command instead of `uninstall`." + description: "Clean up casks using the `zap` command instead of `uninstall`." end sig { override.void } diff --git a/Library/Homebrew/bundle/subcommand/dump.rb b/Library/Homebrew/bundle/subcommand/dump.rb index 33f7da1daed6b..a573b22585601 100644 --- a/Library/Homebrew/bundle/subcommand/dump.rb +++ b/Library/Homebrew/bundle/subcommand/dump.rb @@ -17,20 +17,18 @@ class DumpSubcommand < Homebrew::AbstractSubcommand EOS named_args :none switch "--install", - description: "Run `install` before continuing to other operations, e.g. `exec`." + description: "Run `install` before dumping dependencies." switch "-f", "--force", - description: "`install` runs with `--force`/`--overwrite`. " \ - "`dump` overwrites an existing `Brewfile`. " \ - "`cleanup` actually performs its cleanup operations." + description: "Overwrite an existing `Brewfile`." switch "--formula", "--formulae", "--brews", - description: "`list`, `dump` or `cleanup` Homebrew formula dependencies." + description: "Dump Homebrew formula dependencies." switch "--cask", "--casks", - description: "`list`, `dump` or `cleanup` Homebrew cask dependencies." + description: "Dump Homebrew cask dependencies." switch "--tap", "--taps", - description: "`list`, `dump` or `cleanup` Homebrew tap dependencies." + description: "Dump Homebrew tap dependencies." extensions.select(&:dump_supported?).each do |extension| switch "--#{extension.flag}", - description: extension.switch_description + description: extension.switch_description("Dump #{extension.banner_name}.") end extensions.select(&:dump_disable_supported?).each do |extension| switch "--no-#{extension.flag}", @@ -38,11 +36,11 @@ class DumpSubcommand < Homebrew::AbstractSubcommand env: extension.dump_disable_env end switch "--describe", - description: "`dump` and `add` add a description comment above each line, unless the " \ + description: "Add a description comment above each line, unless the " \ "dependency does not have a description.", env: :bundle_describe switch "--no-restart", - description: "`dump` does not add `restart_service` to formula lines." + description: "Do not add `restart_service` to formula lines." end sig { override.void } diff --git a/Library/Homebrew/bundle/subcommand/edit.rb b/Library/Homebrew/bundle/subcommand/edit.rb index 21958a34ddf9f..1620f0f7d5a88 100644 --- a/Library/Homebrew/bundle/subcommand/edit.rb +++ b/Library/Homebrew/bundle/subcommand/edit.rb @@ -14,7 +14,7 @@ class EditSubcommand < Homebrew::AbstractSubcommand EOS named_args :none switch "--install", - description: "Run `install` before continuing to other operations, e.g. `exec`." + description: "Run `install` before editing the `Brewfile`." end sig { override.void } diff --git a/Library/Homebrew/bundle/subcommand/env.rb b/Library/Homebrew/bundle/subcommand/env.rb index b8d93b4314801..d143129b52eec 100644 --- a/Library/Homebrew/bundle/subcommand/env.rb +++ b/Library/Homebrew/bundle/subcommand/env.rb @@ -14,13 +14,13 @@ class EnvSubcommand < Homebrew::AbstractSubcommand EOS named_args :none switch "--install", - description: "Run `install` before continuing to other operations, e.g. `exec`." + description: "Run `install` before printing the environment." switch "--check", description: "Check that all dependencies in the Brewfile are installed before " \ - "running `exec`, `sh`, or `env`.", + "printing the environment.", env: :bundle_check switch "--no-secrets", - description: "Attempt to remove secrets from the environment before `exec`, `sh`, or `env`.", + description: "Attempt to remove secrets from the environment before printing it.", env: :bundle_no_secrets end diff --git a/Library/Homebrew/bundle/subcommand/exec.rb b/Library/Homebrew/bundle/subcommand/exec.rb index 7165ddd5953f8..3ae95f9297883 100644 --- a/Library/Homebrew/bundle/subcommand/exec.rb +++ b/Library/Homebrew/bundle/subcommand/exec.rb @@ -22,16 +22,16 @@ class ExecSubcommand < Homebrew::AbstractSubcommand EOS named_args :command switch "--install", - description: "Run `install` before continuing to other operations, e.g. `exec`." + description: "Run `install` before executing the command." switch "--services", - description: "Temporarily start services while running the `exec` or `sh` command.", + description: "Temporarily start services while executing the command.", env: :bundle_services switch "--check", description: "Check that all dependencies in the Brewfile are installed before " \ - "running `exec`, `sh`, or `env`.", + "executing the command.", env: :bundle_check switch "--no-secrets", - description: "Attempt to remove secrets from the environment before `exec`, `sh`, or `env`.", + description: "Attempt to remove secrets from the environment before executing the command.", env: :bundle_no_secrets end diff --git a/Library/Homebrew/bundle/subcommand/install.rb b/Library/Homebrew/bundle/subcommand/install.rb index b1aa352dca814..8a31d684ecf3c 100644 --- a/Library/Homebrew/bundle/subcommand/install.rb +++ b/Library/Homebrew/bundle/subcommand/install.rb @@ -22,32 +22,29 @@ class InstallSubcommand < Homebrew::AbstractSubcommand EOS named_args :none switch "-v", "--verbose", - description: "`install` prints output from commands as they are run. " \ - "`check` lists all missing dependencies." + description: "Print output from commands as they are run." switch "--no-upgrade", - description: "`install` does not run `brew upgrade` on outdated dependencies. " \ - "`check` does not check for outdated dependencies. " \ + description: "Do not run `brew upgrade` on outdated dependencies. " \ "Note they may still be upgraded by `brew install` if needed.", env: :bundle_no_upgrade switch "--upgrade", - description: "`install` runs `brew upgrade` on outdated dependencies, " \ + description: "Run `brew upgrade` on outdated dependencies, " \ "even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set." flag "--upgrade-formulae=", "--upgrade-formula=", - description: "`install` runs `brew upgrade` on any of these comma-separated formulae, " \ + description: "Run `brew upgrade` on any of these comma-separated formulae, " \ "even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set." # odeprecated: change default for 5.2 and document HOMEBREW_BUNDLE_JOBS flag "--jobs=", - description: "`install` runs up to this many formula installations in parallel. " \ + description: "Run up to this many formula installations in parallel. " \ "Defaults to 1 (sequential). Use `auto` for the number of CPU cores (max 4)." switch "-f", "--force", - description: "`install` runs with `--force`/`--overwrite`. " \ - "`dump` overwrites an existing `Brewfile`. " \ - "`cleanup` actually performs its cleanup operations." + description: "Run with `--force`/`--overwrite`." switch "--cleanup", - description: "`install` performs cleanup operation, same as running `cleanup --force`.", + description: "Perform cleanup after installing dependencies, same as running `cleanup --force`.", env: [:bundle_install_cleanup, "--global"] switch "--zap", - description: "`cleanup` casks using the `zap` command instead of `uninstall`.", + description: "Use `zap` instead of `uninstall` when cleaning up casks after " \ + "installing dependencies.", depends_on: "--cleanup" end diff --git a/Library/Homebrew/bundle/subcommand/list.rb b/Library/Homebrew/bundle/subcommand/list.rb index 56e5e65ecd5e0..adeaceeb81586 100644 --- a/Library/Homebrew/bundle/subcommand/list.rb +++ b/Library/Homebrew/bundle/subcommand/list.rb @@ -19,18 +19,18 @@ class ListSubcommand < Homebrew::AbstractSubcommand EOS named_args :none switch "--install", - description: "Run `install` before continuing to other operations, e.g. `exec`." + description: "Run `install` before listing dependencies." switch "--all", - description: "`list` all dependencies." + description: "List all dependencies." switch "--formula", "--formulae", "--brews", - description: "`list`, `dump` or `cleanup` Homebrew formula dependencies." + description: "List Homebrew formula dependencies." switch "--cask", "--casks", - description: "`list`, `dump` or `cleanup` Homebrew cask dependencies." + description: "List Homebrew cask dependencies." switch "--tap", "--taps", - description: "`list`, `dump` or `cleanup` Homebrew tap dependencies." + description: "List Homebrew tap dependencies." Homebrew::Bundle.extensions.each do |extension| switch "--#{extension.flag}", - description: extension.switch_description + description: extension.switch_description("List #{extension.banner_name}.") end end diff --git a/Library/Homebrew/bundle/subcommand/remove.rb b/Library/Homebrew/bundle/subcommand/remove.rb index a71770639b135..42cfce3bdec6f 100644 --- a/Library/Homebrew/bundle/subcommand/remove.rb +++ b/Library/Homebrew/bundle/subcommand/remove.rb @@ -17,7 +17,7 @@ class RemoveSubcommand < Homebrew::AbstractSubcommand EOS named_args min: 1 switch "--install", - description: "Run `install` before continuing to other operations, e.g. `exec`." + description: "Run `install` before removing entries." switch "--formula", "--formulae", "--brews", description: "Remove Homebrew formula entries, including matches against formula aliases " \ "and old names." @@ -27,7 +27,7 @@ class RemoveSubcommand < Homebrew::AbstractSubcommand description: "Remove Homebrew tap entries." extensions.select(&:remove_supported?).each do |extension| switch "--#{extension.flag}", - description: extension.switch_description + description: extension.switch_description("Remove entries for #{extension.banner_name}.") end end diff --git a/Library/Homebrew/bundle/subcommand/sh.rb b/Library/Homebrew/bundle/subcommand/sh.rb index e8592431ca5b8..0ba62bb240405 100644 --- a/Library/Homebrew/bundle/subcommand/sh.rb +++ b/Library/Homebrew/bundle/subcommand/sh.rb @@ -14,16 +14,16 @@ class ShSubcommand < Homebrew::AbstractSubcommand EOS named_args :none switch "--install", - description: "Run `install` before continuing to other operations, e.g. `exec`." + description: "Run `install` before starting the shell." switch "--services", - description: "Temporarily start services while running the `exec` or `sh` command.", + description: "Temporarily start services while running the shell.", env: :bundle_services switch "--check", description: "Check that all dependencies in the Brewfile are installed before " \ - "running `exec`, `sh`, or `env`.", + "starting the shell.", env: :bundle_check switch "--no-secrets", - description: "Attempt to remove secrets from the environment before `exec`, `sh`, or `env`.", + description: "Attempt to remove secrets from the environment before starting the shell.", env: :bundle_no_secrets end diff --git a/Library/Homebrew/bundle/subcommand/upgrade.rb b/Library/Homebrew/bundle/subcommand/upgrade.rb index e2b252080d4b0..439c6d3d1d110 100644 --- a/Library/Homebrew/bundle/subcommand/upgrade.rb +++ b/Library/Homebrew/bundle/subcommand/upgrade.rb @@ -14,14 +14,14 @@ class UpgradeSubcommand < Homebrew::AbstractSubcommand EOS named_args :none switch "--upgrade", - description: "`install` runs `brew upgrade` on outdated dependencies, " \ + description: "Run `brew upgrade` on outdated dependencies, " \ "even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set." flag "--upgrade-formulae=", "--upgrade-formula=", - description: "`install` runs `brew upgrade` on any of these comma-separated formulae, " \ + description: "Run `brew upgrade` on any of these comma-separated formulae, " \ "even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set." # odeprecated: change default for 5.2 and document HOMEBREW_BUNDLE_JOBS flag "--jobs=", - description: "`install` runs up to this many formula installations in parallel. " \ + description: "Run up to this many formula installations in parallel. " \ "Defaults to 1 (sequential). Use `auto` for the number of CPU cores (max 4)." end diff --git a/Library/Homebrew/cli/parser.rb b/Library/Homebrew/cli/parser.rb index 4034466232766..ec2bfa3687e6a 100644 --- a/Library/Homebrew/cli/parser.rb +++ b/Library/Homebrew/cli/parser.rb @@ -185,6 +185,10 @@ def initialize(cmd, &block) @option_subcommands = T.let({}, T::Hash[String, T::Array[String]]) @option_types = T.let({}, T::Hash[String, Symbol]) @processed_options = T.let([], Args::OptionsType) + @processed_option_summaries = T.let([], T::Array[[T.untyped, T::Boolean]]) + @processed_options_by_subcommand = T.let({}, T::Hash[T.nilable(String), Args::OptionsType]) + @processed_option_summaries_by_subcommand = + T.let({}, T::Hash[T.nilable(String), T::Array[[T.untyped, T::Boolean]]]) @non_global_processed_options = T.let([], T::Array[[String, ArgType]]) @named_args_type = T.let(nil, T.nilable(ArgType)) @max_named_args = T.let(nil, T.nilable(Integer)) @@ -306,6 +310,9 @@ def usage_banner(text) sig { returns(T.nilable(String)) } def usage_banner_text = @parser.banner + sig { returns(T.nilable(String)) } + def root_usage_banner_text = @usage_banner + sig { returns(ArgType) } def named_args_type return @named_args_type if @subcommands.empty? @@ -514,7 +521,7 @@ def parse(argv = ARGV.freeze, ignore_invalid_options: false) @args_parsed = T.let(true, T.nilable(TrueClass)) if !ignore_invalid_options && @args.help? - puts generate_help_text + puts generate_help_text(remaining_args: @subcommands.present? ? remaining : nil) exit end @@ -527,9 +534,44 @@ def set_default_options; end sig { void } def validate_options; end - sig { returns(String) } - def generate_help_text - Formatter.format_help_text(@parser.to_s, width: Formatter::COMMAND_DESC_WIDTH) + sig { params(remaining_args: T.nilable(T::Array[String])).returns(String) } + def generate_help_text(remaining_args: nil) + help_text = if remaining_args.nil? || @subcommands.empty? + @parser.to_s + elsif (subcommand = remaining_args.filter_map do |arg| + subcommand_for_name(arg) unless arg.start_with?("-") + end.first) + parts = T.let([], T::Array[String]) + parts << (subcommand.usage_banner || "`#{@command_name} #{subcommand.name}`").sub(/\A`brew /, "`") + option_summaries = option_summaries_text(subcommand.name) + parts << option_summaries if option_summaries.present? + parts.join("\n\n") + else + parts = T.let([], T::Array[String]) + usage_banner = @usage_banner + description = @description + parts << usage_banner if usage_banner.present? + parts << description if description.present? + + subcommand_lines = @subcommands.map do |subcommand| + subcommand_summary = if (usage_banner = subcommand.usage_banner) + usage_banner.lines.drop(1).map(&:strip).find(&:present?) + end + subcommand_summary ||= subcommand.description + if subcommand_summary.present? + " `#{subcommand.name}`: #{subcommand_summary}" + else + " `#{subcommand.name}`" + end + end + parts << "Subcommands:\n#{subcommand_lines.join("\n")}" + + option_summaries = option_summaries_text(nil) + parts << option_summaries if option_summaries.present? + parts.join("\n\n") + end + + Formatter.format_help_text(help_text, width: Formatter::COMMAND_DESC_WIDTH) .gsub(/\n.*?@@HIDDEN@@.*?(?=\n)/, "") .sub(/^/, "#{Tty.bold}Usage: brew#{Tty.reset} ") .gsub(/`(.*?)`/m, "#{Tty.bold}\\1#{Tty.reset}") @@ -653,11 +695,15 @@ def processed_options_for_subcommand(subcommand_name) end canonical_subcommand = subcommand&.name - @processed_options.select do |short, long| - [short, long].compact.any? do |option| - option_allowed_for_subcommand?(option_to_name(option), canonical_subcommand) - end - end + root_options = @processed_options_by_subcommand.fetch(nil, []) + return root_options if canonical_subcommand.nil? + + root_options + @processed_options_by_subcommand.fetch(canonical_subcommand, []) + end + + sig { returns(Args::OptionsType) } + def processed_options_for_root_command + @processed_options_by_subcommand.fetch(nil, []) end sig { params(subcommand_name: String).returns(ArgType) } @@ -923,6 +969,27 @@ def usage_description_text parts.join("\n\n") end + sig { params(subcommand_name: T.nilable(String)).returns(String) } + def option_summaries_text(subcommand_name) + lines = T.let([], T::Array[String]) + short_options = T.let({}, T::Hash[String, T::Boolean]) + long_options = T.let({}, T::Hash[String, T::Boolean]) + + processed_option_summaries = @processed_option_summaries_by_subcommand.fetch(nil, []) + if subcommand_name.present? + processed_option_summaries += @processed_option_summaries_by_subcommand.fetch(subcommand_name, []) + end + + processed_option_summaries.each do |option, hidden| + next if hidden + + option.summarize(short_options, long_options, @parser.summary_width, @parser.summary_width - 1, + @parser.summary_indent) { |line| lines << line } + end + + lines.join("\n") + end + sig { params(option: String, subcommand_name: T.nilable(String)).returns(T::Boolean) } def option_allowed_for_subcommand?(option, subcommand_name) subcommands = @option_subcommands[option] @@ -963,7 +1030,33 @@ def record_option_metadata(option_names, type:, subcommands:) def process_option(*args, type:, hidden: false, subcommands: nil) option, = @parser.make_switch(args) @processed_options.reject! { |existing| existing.second == option.long.first } if option.long.first.present? + if option.long.first.present? + @processed_option_summaries.reject! do |existing,| + existing.long.first == option.long.first + end + end @processed_options << [option.short.first, option.long.first, option.desc.first, hidden] + @processed_option_summaries << [option, hidden] + + display_subcommands = effective_subcommands(subcommands) + subcommand_names = T.let([], T::Array[T.nilable(String)]) + if display_subcommands.blank? + subcommand_names << nil + else + subcommand_names.concat(display_subcommands) + end + + subcommand_names.each do |subcommand_name| + processed_options = @processed_options_by_subcommand[subcommand_name] ||= [] + processed_options.reject! { |existing| existing.second == option.long.first } if option.long.first.present? + processed_options << [option.short.first, option.long.first, option.desc.first, hidden] + + processed_option_summaries = @processed_option_summaries_by_subcommand[subcommand_name] ||= [] + if option.long.first.present? + processed_option_summaries.reject! { |existing,| existing.long.first == option.long.first } + end + processed_option_summaries << [option, hidden] + end args.pop # last argument is the description record_option_metadata(args, type:, subcommands:) diff --git a/Library/Homebrew/commands.rb b/Library/Homebrew/commands.rb index 5a29979eb0d9e..a29fc714ee26e 100644 --- a/Library/Homebrew/commands.rb +++ b/Library/Homebrew/commands.rb @@ -220,7 +220,12 @@ def self.command_options(command, subcommand: nil) return if path.blank? if (cmd_parser = Homebrew::CLI::Parser.from_cmd_path(path)) - cmd_parser.processed_options_for_subcommand(subcommand).filter_map do |short, long, desc, hidden| + processed_options = if subcommand.nil? && cmd_parser.subcommands.present? + cmd_parser.processed_options_for_root_command + else + cmd_parser.processed_options_for_subcommand(subcommand) + end + processed_options.filter_map do |short, long, desc, hidden| next if hidden option = long || short diff --git a/Library/Homebrew/completions.rb b/Library/Homebrew/completions.rb index 1a850bc63deca..220e619aabd73 100644 --- a/Library/Homebrew/completions.rb +++ b/Library/Homebrew/completions.rb @@ -190,8 +190,7 @@ def self.generate_bash_named_args_completion(types) sig { params(command: String, subcommands: T::Array[Homebrew::CLI::Parser::Subcommand]).returns(String) } def self.generate_bash_nested_subcommand_completion(command, subcommands) - default_subcommand = subcommands.find(&:default)&.name - top_level_options = command_options(command, subcommand: default_subcommand).keys.sort.join("\n ") + top_level_options = command_options(command).keys.sort.join("\n ") subcommand_names = subcommand_completion_names(subcommands).join(" ") subcommand_cases = subcommands.map do |subcommand| " #{([subcommand.name] + subcommand.aliases).join("|")}) subcommand=\"#{subcommand.name}\"; break ;;" @@ -379,10 +378,9 @@ def self.generate_zsh_arguments(command, options, types) sig { params(command: String, subcommands: T::Array[Homebrew::CLI::Parser::Subcommand]).returns(String) } def self.generate_zsh_nested_subcommand_completion(command, subcommands) - default_subcommand = subcommands.find(&:default)&.name top_level_arguments = generate_zsh_arguments( command, - command_options(command, subcommand: default_subcommand), + command_options(command), nil, ).map { |opt| format_zsh_argument(opt) } + [ "'1:subcommand:->subcommand'", @@ -588,8 +586,7 @@ def self.generate_fish_nested_subcommand_completion(command, subcommands) end end - default_subcommand = subcommands.find(&:default)&.name - lines += command_options(command, subcommand: default_subcommand).sort.filter_map do |opt, desc| + lines += command_options(command).sort.filter_map do |opt, desc| arg_line = "__fish_brew_complete_arg '#{command}; and [ (count (__fish_brew_args)) = 1 ]' " \ "-l #{opt.sub(/^-+/, "")}" arg_line += " -d '#{format_description desc, fish: true}'" if desc.present? diff --git a/Library/Homebrew/help.rb b/Library/Homebrew/help.rb index 7cd31caa8d91f..9b3170b682806 100644 --- a/Library/Homebrew/help.rb +++ b/Library/Homebrew/help.rb @@ -37,7 +37,7 @@ def self.help(cmd = nil, empty_argv: false, usage_error: nil, remaining_args: [] # Display command-specific (or generic) help in response to `UsageError`. if usage_error - $stderr.puts path ? command_help(cmd, path, remaining_args:) : HOMEBREW_HELP_MESSAGE + $stderr.puts path ? command_help(cmd, path, remaining_args:, usage_error: true) : HOMEBREW_HELP_MESSAGE $stderr.puts onoe usage_error exit 1 @@ -47,7 +47,7 @@ def self.help(cmd = nil, empty_argv: false, usage_error: nil, remaining_args: [] return if path.nil? # Display help for internal command (or generic help if undocumented). - puts command_help(cmd, path, remaining_args:) + puts command_help(cmd, path, remaining_args:, usage_error: false) exit 0 end @@ -56,14 +56,15 @@ def self.help(cmd = nil, empty_argv: false, usage_error: nil, remaining_args: [] cmd: String, path: Pathname, remaining_args: T::Array[String], + usage_error: T::Boolean, ).returns(String) } - def self.command_help(cmd, path, remaining_args:) + def self.command_help(cmd, path, remaining_args:, usage_error:) # Only some types of commands can have a parser. output = if Commands.valid_internal_cmd?(cmd) || Commands.valid_internal_dev_cmd?(cmd) || Commands.external_ruby_v2_cmd_path(cmd) - parser_help(path, remaining_args:) + parser_help(path, remaining_args:, usage_error:) end output ||= comment_help(path) @@ -85,16 +86,18 @@ def self.command_help(cmd, path, remaining_args:) params( path: Pathname, remaining_args: T::Array[String], + usage_error: T::Boolean, ).returns(T.nilable(String)) } - def self.parser_help(path, remaining_args:) + def self.parser_help(path, remaining_args:, usage_error:) # Let OptionParser generate help text for commands which have a parser. cmd_parser = CLI::Parser.from_cmd_path(path) return unless cmd_parser # Try parsing arguments here in order to show formula options in help output. cmd_parser.parse(remaining_args, ignore_invalid_options: true) - cmd_parser.generate_help_text + remaining_args = cmd_parser.args.remaining if usage_error || cmd_parser.subcommands.present? + cmd_parser.generate_help_text(remaining_args:) end private_class_method :parser_help diff --git a/Library/Homebrew/manpages.rb b/Library/Homebrew/manpages.rb index 0eecc390bb876..0c8832cb8ef9c 100644 --- a/Library/Homebrew/manpages.rb +++ b/Library/Homebrew/manpages.rb @@ -98,9 +98,34 @@ def self.generate_cmd_manpages(cmd_paths) sig { params(cmd_parser: CLI::Parser).returns(T::Array[String]) } def self.cmd_parser_manpage_lines(cmd_parser) lines = [] - usage_banner_text = cmd_parser.usage_banner_text - lines << format_usage_banner(usage_banner_text) if usage_banner_text - lines += cmd_parser.processed_options.filter_map do |short, long, desc, hidden| + if cmd_parser.subcommands.present? + root_usage_banner_text = cmd_parser.root_usage_banner_text + lines << "#{format_usage_banner(root_usage_banner_text)}\n\n" if root_usage_banner_text + if (description = cmd_parser.description).present? + lines << "#{description}\n\n" + end + + root_options = cmd_parser.processed_options_for_root_command + lines += option_manpage_lines(root_options) + + cmd_parser.subcommands.each do |subcommand| + usage_banner = subcommand.usage_banner + next if usage_banner.blank? + + lines << "#{format_usage_text(usage_banner)}\n\n" + lines += option_manpage_lines(cmd_parser.processed_options_for_subcommand(subcommand.name) - root_options) + end + else + usage_banner_text = cmd_parser.usage_banner_text + lines << format_usage_banner(usage_banner_text) if usage_banner_text + lines += option_manpage_lines(cmd_parser.processed_options) + end + lines + end + + sig { params(options: CLI::Args::OptionsType).returns(T::Array[String]) } + def self.option_manpage_lines(options) + options.filter_map do |short, long, desc, hidden| next if hidden if long.present? @@ -112,8 +137,8 @@ def self.cmd_parser_manpage_lines(cmd_parser) generate_option_doc(short, long, desc) end - lines end + private_class_method :option_manpage_lines sig { params(cmd_path: Pathname).returns(T.nilable(T::Array[String])) } def self.cmd_comment_manpage_lines(cmd_path) @@ -211,8 +236,13 @@ def self.generate_option_doc(short, long, desc) sig { params(usage_banner: String).returns(String) } def self.format_usage_banner(usage_banner) - usage_banner.sub(/^(#: *\* )?/, "### ") - .gsub(/(? on all services." + description: "List all managed services." switch "--json", description: "Output as JSON." end diff --git a/Library/Homebrew/services/subcommand/kill.rb b/Library/Homebrew/services/subcommand/kill.rb index cb2dc5aa1fd12..75e8a099bb55c 100644 --- a/Library/Homebrew/services/subcommand/kill.rb +++ b/Library/Homebrew/services/subcommand/kill.rb @@ -15,7 +15,7 @@ class KillSubcommand < Homebrew::AbstractSubcommand EOS named_args :service switch "--all", - description: "Run on all services." + description: "Stop all services immediately but keep them registered to launch at login (or boot)." end sig { override.void } diff --git a/Library/Homebrew/services/subcommand/restart.rb b/Library/Homebrew/services/subcommand/restart.rb index 0220ae50720d7..5613e7e57efd5 100644 --- a/Library/Homebrew/services/subcommand/restart.rb +++ b/Library/Homebrew/services/subcommand/restart.rb @@ -17,7 +17,7 @@ class RestartSubcommand < Homebrew::AbstractSubcommand flag "--file=", description: "Use the service file from this location to `start` the service." switch "--all", - description: "Run on all services." + description: "Restart all services." end sig { override.void } diff --git a/Library/Homebrew/services/subcommand/run.rb b/Library/Homebrew/services/subcommand/run.rb index 57de52447f29e..1eb4cb57c7989 100644 --- a/Library/Homebrew/services/subcommand/run.rb +++ b/Library/Homebrew/services/subcommand/run.rb @@ -17,7 +17,7 @@ class RunSubcommand < Homebrew::AbstractSubcommand flag "--file=", description: "Use the service file from this location to `run` the service." switch "--all", - description: "Run on all services." + description: "Run all services without registering them to launch at login (or boot)." end sig { override.void } diff --git a/Library/Homebrew/services/subcommand/start.rb b/Library/Homebrew/services/subcommand/start.rb index 780248668f5ae..60276f69e41ed 100644 --- a/Library/Homebrew/services/subcommand/start.rb +++ b/Library/Homebrew/services/subcommand/start.rb @@ -17,7 +17,7 @@ class StartSubcommand < Homebrew::AbstractSubcommand flag "--file=", description: "Use the service file from this location to `start` the service." switch "--all", - description: "Run on all services." + description: "Start all services and register them to launch at login (or boot)." end sig { override.void } diff --git a/Library/Homebrew/services/subcommand/stop.rb b/Library/Homebrew/services/subcommand/stop.rb index 8900e1bb35141..7f8ecbeae40c3 100644 --- a/Library/Homebrew/services/subcommand/stop.rb +++ b/Library/Homebrew/services/subcommand/stop.rb @@ -23,7 +23,8 @@ class StopSubcommand < Homebrew::AbstractSubcommand switch "--keep", description: "When stopped, don't unregister the service from launching at login (or boot)." switch "--all", - description: "Run on all services." + description: "Stop all services and unregister them from launching at login (or boot), " \ + "unless `--keep` is specified." end sig { override.void } diff --git a/Library/Homebrew/test/cli/parser_spec.rb b/Library/Homebrew/test/cli/parser_spec.rb index f799f44bb1697..50cd18813e9e8 100644 --- a/Library/Homebrew/test/cli/parser_spec.rb +++ b/Library/Homebrew/test/cli/parser_spec.rb @@ -578,6 +578,8 @@ describe "subcommands" do def subcommand_parser described_class.new(Cmd) do + usage_banner "`test` []" + description "Test command." switch "--global" subcommand "install", default: true do @@ -615,6 +617,45 @@ def subcommand_parser expect(subcommand_parser.usage_banner_text).to include("Show service information.") end + it "generates usage-error help for the matched subcommand" do + help_text = subcommand_parser.generate_help_text(remaining_args: %w[info foo --force]) + + expect(help_text).to include("Usage: brew test info service:") + expect(help_text).to include("Show service information.") + expect(help_text).to include("--json") + expect(help_text).to include("--global") + expect(help_text).not_to include("--force") + expect(help_text).not_to include("Usage: brew test install") + end + + it "generates usage-error help for the root command when no subcommand matches" do + help_text = subcommand_parser.generate_help_text(remaining_args: ["unknown"]) + + expect(help_text).to include("Usage: brew test [subcommand]") + expect(help_text).to include("Subcommands:") + expect(help_text).to include("install") + expect(help_text).to include("info") + expect(help_text).to include("--global") + expect(help_text).not_to include("--force") + expect(help_text).not_to include("--json") + expect(help_text).not_to include("Usage: brew test install") + expect(help_text).not_to include("Usage: brew test info") + end + + it "prints root command help for the help switch" do + expect { subcommand_parser.parse(["--help"]) } + .to output(/\A(?=.*Subcommands:)(?=.*--global)(?!.*--force)(?!.*--json)(?!.*Usage: brew test install)/m) + .to_stdout + .and raise_error(SystemExit) + end + + it "prints matched subcommand help for the help switch" do + expect { subcommand_parser.parse(%w[install --help]) } + .to output(/\A(?=.*Usage: brew test install)(?=.*--force)(?=.*--global)(?!.*--json)(?!.*Subcommands:)/m) + .to_stdout + .and raise_error(SystemExit) + end + it "stores the canonical subcommand name" do args = subcommand_parser.parse(%w[i foo --json]) diff --git a/Library/Homebrew/test/cmd/bundle_spec.rb b/Library/Homebrew/test/cmd/bundle_spec.rb index 7f968f5cdb4da..e17861061417e 100644 --- a/Library/Homebrew/test/cmd/bundle_spec.rb +++ b/Library/Homebrew/test/cmd/bundle_spec.rb @@ -3,6 +3,7 @@ require "cmd/bundle" require "cmd/shared_examples/args_parse" +require "commands" RSpec.describe Homebrew::Cmd::Bundle do it_behaves_like "parseable arguments" @@ -21,6 +22,25 @@ .to raise_error(UsageError, /`exec` subcommand does not accept the `--jobs` flag/) end + it "uses subcommand-specific option descriptions", :aggregate_failures do + subcommand_options = ->(subcommand) { Commands.command_options("bundle", subcommand:).to_h } + + expect(subcommand_options.call("list")["--vscode"]).to eq("List VSCode (and forks/variants) extensions.") + expect(subcommand_options.call("dump")["--vscode"]).to eq("Dump VSCode (and forks/variants) extensions.") + expect(subcommand_options.call("cleanup")["--vscode"]).to eq("Clean up VSCode (and forks/variants) extensions.") + expect(subcommand_options.call("add")["--vscode"]) + .to eq("Add entries for VSCode (and forks/variants) extensions.") + expect(subcommand_options.call("remove")["--vscode"]) + .to eq("Remove entries for VSCode (and forks/variants) extensions.") + end + + it "uses subcommand-specific descriptions in help output", :aggregate_failures do + help_text = described_class.parser.generate_help_text(remaining_args: ["list"]) + + expect(help_text).to include("List VSCode (and forks/variants) extensions.") + expect(help_text).not_to include("Clean up VSCode (and forks/variants) extensions.") + end + [ ["exec", ["exec", "--check", "/usr/bin/true"], "/usr/bin/true"], ["sh", ["sh", "--check"], "sh"], diff --git a/Library/Homebrew/test/cmd/services_spec.rb b/Library/Homebrew/test/cmd/services_spec.rb index 4d08609974efa..e17d0dd7f58fd 100644 --- a/Library/Homebrew/test/cmd/services_spec.rb +++ b/Library/Homebrew/test/cmd/services_spec.rb @@ -17,6 +17,25 @@ .to raise_error(UsageError, /`info` subcommand does not accept the `--file` flag/) end + it "uses operation-specific --all descriptions", :aggregate_failures do + subcommand_options = lambda do |subcommand| + described_class.parser.processed_options_for_subcommand(subcommand).filter_map do |_, long, description, hidden| + [long, description] unless hidden + end.to_h + end + + expect(subcommand_options.call("start")["--all"]) + .to eq("Start all services and register them to launch at login (or boot).") + expect(subcommand_options.call("stop")["--all"]) + .to eq("Stop all services and unregister them from launching at login (or boot), unless `--keep` is specified.") + expect(subcommand_options.call("run")["--all"]) + .to eq("Run all services without registering them to launch at login (or boot).") + expect(subcommand_options.call("restart")["--all"]).to eq("Restart all services.") + expect(subcommand_options.call("kill")["--all"]) + .to eq("Stop all services immediately but keep them registered to launch at login (or boot).") + expect(subcommand_options.call("info")["--all"]).to eq("List all managed services.") + end + it "allows controlling services", :integration_test do expect { brew "services", "list" } .to not_to_output.to_stderr diff --git a/Library/Homebrew/test/completions_spec.rb b/Library/Homebrew/test/completions_spec.rb index 81b8dd4ef7cee..e70a39f47469b 100644 --- a/Library/Homebrew/test/completions_spec.rb +++ b/Library/Homebrew/test/completions_spec.rb @@ -192,10 +192,10 @@ def stub_nested_completion_command(command, subcommands) allow(Commands).to receive(:command_options).and_call_original allow(Commands).to receive(:command_options) .with(command, subcommand: nil) - .and_return([]) + .and_return([["--global", "Use the global test file."]]) allow(Commands).to receive(:command_options) .with(command, subcommand: "list") - .and_return([["--all", "Run on all services."]]) + .and_return([["--all", "List all test services."]]) allow(Commands).to receive(:command_options) .with(command, subcommand: "info") .and_return([["--json", "Output as JSON."]]) @@ -285,9 +285,12 @@ def stub_nested_completion_command(command, subcommands) it "returns options for a nested subcommand" do stub_nested_completion_command(nested_completion_command, nested_completion_subcommands) + root_options = described_class.command_options(nested_completion_command) info_options = described_class.command_options(nested_completion_command, subcommand: "info") start_options = described_class.command_options(nested_completion_command, subcommand: "start") + expect(root_options).to include("--global") + expect(root_options).not_to include("--all") expect(info_options).to include("--json") expect(info_options).not_to include("--file") expect(start_options).to include("--file") @@ -372,6 +375,9 @@ def stub_nested_completion_command(command, subcommands) expect(completion).to include('info|i) subcommand="info"; break ;;') expect(completion).to include('__brewcomp "list ls info i start s"') + expect(completion).to include(" --global\n \"") + expect(completion).not_to include(" --all\n \"") + expect(completion).to include("list)\n __brewcomp \"\n --all") expect(completion).to include("__brew_complete_services") expect(completion).to include(" *) ;;\n esac\n ;;") end @@ -446,8 +452,11 @@ def stub_nested_completion_command(command, subcommands) completion = described_class.generate_zsh_subcommand_completion(nested_completion_command) expect(completion).to include("'1:subcommand:->subcommand'") - expect(completion).to include(" _arguments -C \\\n '--all[Run subcommand on all services]' \\\n " \ + expect(completion).to include(" _arguments -C \\\n '--global[Use the global test file]' \\\n " \ "'1:subcommand:->subcommand'") + expect(completion).to include( + "list|ls)\n _arguments \\\n '--all[List all test services]'", + ) expect(completion).to include("'i:Show service information'") expect(completion).to include("info|i)") expect(completion).to include("*:service:__brew_services") @@ -520,6 +529,10 @@ def stub_nested_completion_command(command, subcommands) expect(completion).to include("__fish_brew_complete_sub_cmd 'subcommand-test' 'info'") expect(completion).to include("__fish_brew_complete_sub_cmd 'subcommand-test' 'i' " \ "'Show service information'") + root_option = "__fish_brew_complete_arg 'subcommand-test; and [ (count (__fish_brew_args)) = 1 ]' " + expect(completion).to include("#{root_option}-l global -d 'Use the global test file'") + expect(completion).to include("__fish_brew_complete_sub_arg 'subcommand-test' 'list ls' " \ + "-l all -d 'List all test services'") expect(completion).to include("__fish_brew_complete_sub_arg 'subcommand-test' 'info i' " \ "-a '(__fish_brew_suggest_services)'") end diff --git a/Library/Homebrew/test/manpages_spec.rb b/Library/Homebrew/test/manpages_spec.rb new file mode 100644 index 0000000000000..208702bfa5453 --- /dev/null +++ b/Library/Homebrew/test/manpages_spec.rb @@ -0,0 +1,48 @@ +# typed: false +# frozen_string_literal: true + +require "manpages" + +RSpec.describe Homebrew::Manpages do + before { stub_const("Cmd", Class.new(Homebrew::AbstractCommand)) } + + def subcommand_parser + Homebrew::CLI::Parser.new(Cmd) do + usage_banner "`test` []" + description "Test command." + switch "--global" + + subcommand "install", default: true do + usage_banner <<~EOS + `test install`: + Install dependencies. + EOS + switch "--force" + named_args :none + end + + subcommand "info" do + usage_banner <<~EOS + `test info` : + Show service information. + EOS + switch "--json" + named_args :service, min: 1 + end + end + end + + it "lists options under the root command and matching subcommands", :aggregate_failures do + root_section, install_and_info_sections = described_class.cmd_parser_manpage_lines(subcommand_parser).join + .split("`test install`:") + install_section, info_section = install_and_info_sections.split("`test info` :") + + expect(root_section).to include("`--global`") + expect(root_section).not_to include("`--force`") + expect(root_section).not_to include("`--json`") + expect(install_section).to include("`--force`") + expect(install_section).not_to include("`--json`") + expect(info_section).to include("`--json`") + expect(info_section).not_to include("`--force`") + end +end diff --git a/completions/bash/brew b/completions/bash/brew index cdcfec648eacd..8da7a88b77366 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -749,17 +749,11 @@ _brew_bundle() { case "${subcommand}" in "") __brewcomp " - --cleanup --debug --file - --force --global --help - --jobs - --no-upgrade --quiet - --upgrade - --upgrade-formulae --verbose " return @@ -774,6 +768,7 @@ upgrade) --quiet --upgrade --upgrade-formulae + --verbose " return ;; @@ -788,6 +783,7 @@ sh) --no-secrets --quiet --services + --verbose " return ;; @@ -809,6 +805,7 @@ remove) --quiet --tap --uv + --verbose --vscode " return @@ -832,6 +829,7 @@ list) --quiet --tap --uv + --verbose --vscode " return @@ -850,6 +848,7 @@ install) --upgrade --upgrade-formulae --verbose + --zap " return ;; @@ -864,6 +863,7 @@ exec) --no-secrets --quiet --services + --verbose " return ;; @@ -877,6 +877,7 @@ env) --install --no-secrets --quiet + --verbose " return ;; @@ -888,6 +889,7 @@ edit) --help --install --quiet + --verbose " return ;; @@ -919,6 +921,7 @@ dump) --quiet --tap --uv + --verbose --vscode " return @@ -940,6 +943,7 @@ cleanup) --quiet --tap --uv + --verbose --vscode --zap " @@ -976,6 +980,7 @@ add) --quiet --tap --uv + --verbose --vscode " return @@ -2831,7 +2836,6 @@ _brew_services() { __brewcomp " --debug --help - --json --quiet --sudo-service-user --verbose diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index bcfa549b90e46..5625193e99fc9 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -533,175 +533,180 @@ __fish_brew_complete_sub_cmd 'bundle' 'dump' 'Write all installed casks/formulae __fish_brew_complete_sub_cmd 'bundle' 'cleanup' 'This workflow is useful for maintainers or testers who regularly install lots of formulae' __fish_brew_complete_sub_cmd 'bundle' 'check' 'This provides a successful exit code if everything is up-to-date, making it useful for scripting. Use `--verbose` to list unmet dependencies' __fish_brew_complete_sub_cmd 'bundle' 'add' 'Add entries to your `Brewfile`. Adds formulae by default. Use `--cask`, `--tap`, `--vscode`, `--go`, `--cargo`, `--uv`, `--flatpak`, `--krew` and `--npm` to add the corresponding entry instead' -__fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l cleanup -d '`install` performs cleanup operation, same as running `cleanup --force`. Enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` is passed' __fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' -__fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l force -d '`install` runs with `--force`/`--overwrite`. `dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations' __fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' __fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l help -d 'Show this message' -__fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l jobs -d '`install` runs up to this many formula installations in parallel. Defaults to 1 (sequential). Use `auto` for the number of CPU cores (max 4)' -__fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l no-upgrade -d '`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' __fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l upgrade -d '`install` runs `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' -__fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l upgrade-formulae -d '`install` runs `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' -__fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l verbose -d '`install` prints output from commands as they are run. `check` lists all missing dependencies' +__fish_brew_complete_arg 'bundle; and [ (count (__fish_brew_args)) = 1 ]' -l verbose -d 'Make some output more verbose' __fish_brew_complete_sub_arg 'bundle' 'upgrade' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'bundle' 'upgrade' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' __fish_brew_complete_sub_arg 'bundle' 'upgrade' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' __fish_brew_complete_sub_arg 'bundle' 'upgrade' -l help -d 'Show this message' -__fish_brew_complete_sub_arg 'bundle' 'upgrade' -l jobs -d '`install` runs up to this many formula installations in parallel. Defaults to 1 (sequential). Use `auto` for the number of CPU cores (max 4)' +__fish_brew_complete_sub_arg 'bundle' 'upgrade' -l jobs -d 'Run up to this many formula installations in parallel. Defaults to 1 (sequential). Use `auto` for the number of CPU cores (max 4)' __fish_brew_complete_sub_arg 'bundle' 'upgrade' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_sub_arg 'bundle' 'upgrade' -l upgrade -d '`install` runs `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' -__fish_brew_complete_sub_arg 'bundle' 'upgrade' -l upgrade-formulae -d '`install` runs `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' -__fish_brew_complete_sub_arg 'bundle' 'sh' -l check -d 'Check that all dependencies in the Brewfile are installed before running `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set' +__fish_brew_complete_sub_arg 'bundle' 'upgrade' -l upgrade -d 'Run `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' +__fish_brew_complete_sub_arg 'bundle' 'upgrade' -l upgrade-formulae -d 'Run `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' +__fish_brew_complete_sub_arg 'bundle' 'upgrade' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_sub_arg 'bundle' 'sh' -l check -d 'Check that all dependencies in the Brewfile are installed before starting the shell. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set' __fish_brew_complete_sub_arg 'bundle' 'sh' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'bundle' 'sh' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' __fish_brew_complete_sub_arg 'bundle' 'sh' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' __fish_brew_complete_sub_arg 'bundle' 'sh' -l help -d 'Show this message' -__fish_brew_complete_sub_arg 'bundle' 'sh' -l install -d 'Run `install` before continuing to other operations, e.g. `exec`' -__fish_brew_complete_sub_arg 'bundle' 'sh' -l no-secrets -d 'Attempt to remove secrets from the environment before `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set' +__fish_brew_complete_sub_arg 'bundle' 'sh' -l install -d 'Run `install` before starting the shell' +__fish_brew_complete_sub_arg 'bundle' 'sh' -l no-secrets -d 'Attempt to remove secrets from the environment before starting the shell. Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set' __fish_brew_complete_sub_arg 'bundle' 'sh' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_sub_arg 'bundle' 'sh' -l services -d 'Temporarily start services while running the `exec` or `sh` command. Enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set' -__fish_brew_complete_sub_arg 'bundle' 'remove' -l cargo -d '`list`, `dump` or `cleanup` Cargo packages' -__fish_brew_complete_sub_arg 'bundle' 'remove' -l cask -d 'Add Homebrew cask entries' +__fish_brew_complete_sub_arg 'bundle' 'sh' -l services -d 'Temporarily start services while running the shell. Enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set' +__fish_brew_complete_sub_arg 'bundle' 'sh' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l cargo -d 'Remove entries for Cargo packages' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l cask -d 'Remove Homebrew cask entries' __fish_brew_complete_sub_arg 'bundle' 'remove' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'bundle' 'remove' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' -__fish_brew_complete_sub_arg 'bundle' 'remove' -l flatpak -d '`list`, `dump` or `cleanup` Flatpak packages. Note: Linux only' -__fish_brew_complete_sub_arg 'bundle' 'remove' -l formula -d 'Add Homebrew formula entries' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l flatpak -d 'Remove entries for Flatpak packages. Note: Linux only' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l formula -d 'Remove Homebrew formula entries, including matches against formula aliases and old names' __fish_brew_complete_sub_arg 'bundle' 'remove' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' -__fish_brew_complete_sub_arg 'bundle' 'remove' -l go -d '`list`, `dump` or `cleanup` Go packages' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l go -d 'Remove entries for Go packages' __fish_brew_complete_sub_arg 'bundle' 'remove' -l help -d 'Show this message' -__fish_brew_complete_sub_arg 'bundle' 'remove' -l install -d 'Run `install` before continuing to other operations, e.g. `exec`' -__fish_brew_complete_sub_arg 'bundle' 'remove' -l krew -d '`list` or `dump` Krew plugins' -__fish_brew_complete_sub_arg 'bundle' 'remove' -l mas -d '`list` or `dump` Mac App Store dependencies' -__fish_brew_complete_sub_arg 'bundle' 'remove' -l npm -d '`list`, `dump` or `cleanup` npm packages' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l install -d 'Run `install` before removing entries' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l krew -d 'Remove entries for Krew plugins' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l mas -d 'Remove entries for Mac App Store dependencies' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l npm -d 'Remove entries for npm packages' __fish_brew_complete_sub_arg 'bundle' 'remove' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_sub_arg 'bundle' 'remove' -l tap -d 'Add Homebrew tap entries' -__fish_brew_complete_sub_arg 'bundle' 'remove' -l uv -d '`list`, `dump` or `cleanup` uv tools' -__fish_brew_complete_sub_arg 'bundle' 'remove' -l vscode -d '`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions' -__fish_brew_complete_sub_arg 'bundle' 'list' -l all -d '`list` all dependencies' -__fish_brew_complete_sub_arg 'bundle' 'list' -l cargo -d '`list`, `dump` or `cleanup` Cargo packages' -__fish_brew_complete_sub_arg 'bundle' 'list' -l cask -d 'Add Homebrew cask entries' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l tap -d 'Remove Homebrew tap entries' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l uv -d 'Remove entries for uv tools' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_sub_arg 'bundle' 'remove' -l vscode -d 'Remove entries for VSCode (and forks/variants) extensions' +__fish_brew_complete_sub_arg 'bundle' 'list' -l all -d 'List all dependencies' +__fish_brew_complete_sub_arg 'bundle' 'list' -l cargo -d 'List Cargo packages' +__fish_brew_complete_sub_arg 'bundle' 'list' -l cask -d 'List Homebrew cask dependencies' __fish_brew_complete_sub_arg 'bundle' 'list' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'bundle' 'list' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' -__fish_brew_complete_sub_arg 'bundle' 'list' -l flatpak -d '`list`, `dump` or `cleanup` Flatpak packages. Note: Linux only' -__fish_brew_complete_sub_arg 'bundle' 'list' -l formula -d 'Add Homebrew formula entries' +__fish_brew_complete_sub_arg 'bundle' 'list' -l flatpak -d 'List Flatpak packages. Note: Linux only' +__fish_brew_complete_sub_arg 'bundle' 'list' -l formula -d 'List Homebrew formula dependencies' __fish_brew_complete_sub_arg 'bundle' 'list' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' -__fish_brew_complete_sub_arg 'bundle' 'list' -l go -d '`list`, `dump` or `cleanup` Go packages' +__fish_brew_complete_sub_arg 'bundle' 'list' -l go -d 'List Go packages' __fish_brew_complete_sub_arg 'bundle' 'list' -l help -d 'Show this message' -__fish_brew_complete_sub_arg 'bundle' 'list' -l install -d 'Run `install` before continuing to other operations, e.g. `exec`' -__fish_brew_complete_sub_arg 'bundle' 'list' -l krew -d '`list` or `dump` Krew plugins' -__fish_brew_complete_sub_arg 'bundle' 'list' -l mas -d '`list` or `dump` Mac App Store dependencies' -__fish_brew_complete_sub_arg 'bundle' 'list' -l npm -d '`list`, `dump` or `cleanup` npm packages' +__fish_brew_complete_sub_arg 'bundle' 'list' -l install -d 'Run `install` before listing dependencies' +__fish_brew_complete_sub_arg 'bundle' 'list' -l krew -d 'List Krew plugins' +__fish_brew_complete_sub_arg 'bundle' 'list' -l mas -d 'List Mac App Store dependencies' +__fish_brew_complete_sub_arg 'bundle' 'list' -l npm -d 'List npm packages' __fish_brew_complete_sub_arg 'bundle' 'list' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_sub_arg 'bundle' 'list' -l tap -d 'Add Homebrew tap entries' -__fish_brew_complete_sub_arg 'bundle' 'list' -l uv -d '`list`, `dump` or `cleanup` uv tools' -__fish_brew_complete_sub_arg 'bundle' 'list' -l vscode -d '`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions' -__fish_brew_complete_sub_arg 'bundle' 'install' -l cleanup -d '`install` performs cleanup operation, same as running `cleanup --force`. Enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` is passed' +__fish_brew_complete_sub_arg 'bundle' 'list' -l tap -d 'List Homebrew tap dependencies' +__fish_brew_complete_sub_arg 'bundle' 'list' -l uv -d 'List uv tools' +__fish_brew_complete_sub_arg 'bundle' 'list' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_sub_arg 'bundle' 'list' -l vscode -d 'List VSCode (and forks/variants) extensions' +__fish_brew_complete_sub_arg 'bundle' 'install' -l cleanup -d 'Perform cleanup after installing dependencies, same as running `cleanup --force`. Enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` is passed' __fish_brew_complete_sub_arg 'bundle' 'install' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'bundle' 'install' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' -__fish_brew_complete_sub_arg 'bundle' 'install' -l force -d '`install` runs with `--force`/`--overwrite`. `dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations' +__fish_brew_complete_sub_arg 'bundle' 'install' -l force -d 'Run with `--force`/`--overwrite`' __fish_brew_complete_sub_arg 'bundle' 'install' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' __fish_brew_complete_sub_arg 'bundle' 'install' -l help -d 'Show this message' -__fish_brew_complete_sub_arg 'bundle' 'install' -l jobs -d '`install` runs up to this many formula installations in parallel. Defaults to 1 (sequential). Use `auto` for the number of CPU cores (max 4)' -__fish_brew_complete_sub_arg 'bundle' 'install' -l no-upgrade -d '`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' +__fish_brew_complete_sub_arg 'bundle' 'install' -l jobs -d 'Run up to this many formula installations in parallel. Defaults to 1 (sequential). Use `auto` for the number of CPU cores (max 4)' +__fish_brew_complete_sub_arg 'bundle' 'install' -l no-upgrade -d 'Do not run `brew upgrade` on outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' __fish_brew_complete_sub_arg 'bundle' 'install' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_sub_arg 'bundle' 'install' -l upgrade -d '`install` runs `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' -__fish_brew_complete_sub_arg 'bundle' 'install' -l upgrade-formulae -d '`install` runs `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' -__fish_brew_complete_sub_arg 'bundle' 'install' -l verbose -d '`install` prints output from commands as they are run. `check` lists all missing dependencies' -__fish_brew_complete_sub_arg 'bundle' 'exec' -l check -d 'Check that all dependencies in the Brewfile are installed before running `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set' +__fish_brew_complete_sub_arg 'bundle' 'install' -l upgrade -d 'Run `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' +__fish_brew_complete_sub_arg 'bundle' 'install' -l upgrade-formulae -d 'Run `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' +__fish_brew_complete_sub_arg 'bundle' 'install' -l verbose -d 'Print output from commands as they are run' +__fish_brew_complete_sub_arg 'bundle' 'install' -l zap -d 'Use `zap` instead of `uninstall` when cleaning up casks after installing dependencies' +__fish_brew_complete_sub_arg 'bundle' 'exec' -l check -d 'Check that all dependencies in the Brewfile are installed before executing the command. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set' __fish_brew_complete_sub_arg 'bundle' 'exec' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'bundle' 'exec' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' __fish_brew_complete_sub_arg 'bundle' 'exec' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' __fish_brew_complete_sub_arg 'bundle' 'exec' -l help -d 'Show this message' -__fish_brew_complete_sub_arg 'bundle' 'exec' -l install -d 'Run `install` before continuing to other operations, e.g. `exec`' -__fish_brew_complete_sub_arg 'bundle' 'exec' -l no-secrets -d 'Attempt to remove secrets from the environment before `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set' +__fish_brew_complete_sub_arg 'bundle' 'exec' -l install -d 'Run `install` before executing the command' +__fish_brew_complete_sub_arg 'bundle' 'exec' -l no-secrets -d 'Attempt to remove secrets from the environment before executing the command. Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set' __fish_brew_complete_sub_arg 'bundle' 'exec' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_sub_arg 'bundle' 'exec' -l services -d 'Temporarily start services while running the `exec` or `sh` command. Enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set' +__fish_brew_complete_sub_arg 'bundle' 'exec' -l services -d 'Temporarily start services while executing the command. Enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set' +__fish_brew_complete_sub_arg 'bundle' 'exec' -l verbose -d 'Make some output more verbose' __fish_brew_complete_sub_arg 'bundle' 'exec' -a '(__fish_brew_suggest_commands)' -__fish_brew_complete_sub_arg 'bundle' 'env' -l check -d 'Check that all dependencies in the Brewfile are installed before running `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set' +__fish_brew_complete_sub_arg 'bundle' 'env' -l check -d 'Check that all dependencies in the Brewfile are installed before printing the environment. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set' __fish_brew_complete_sub_arg 'bundle' 'env' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'bundle' 'env' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' __fish_brew_complete_sub_arg 'bundle' 'env' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' __fish_brew_complete_sub_arg 'bundle' 'env' -l help -d 'Show this message' -__fish_brew_complete_sub_arg 'bundle' 'env' -l install -d 'Run `install` before continuing to other operations, e.g. `exec`' -__fish_brew_complete_sub_arg 'bundle' 'env' -l no-secrets -d 'Attempt to remove secrets from the environment before `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set' +__fish_brew_complete_sub_arg 'bundle' 'env' -l install -d 'Run `install` before printing the environment' +__fish_brew_complete_sub_arg 'bundle' 'env' -l no-secrets -d 'Attempt to remove secrets from the environment before printing it. Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set' __fish_brew_complete_sub_arg 'bundle' 'env' -l quiet -d 'Make some output more quiet' +__fish_brew_complete_sub_arg 'bundle' 'env' -l verbose -d 'Make some output more verbose' __fish_brew_complete_sub_arg 'bundle' 'edit' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'bundle' 'edit' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' __fish_brew_complete_sub_arg 'bundle' 'edit' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' __fish_brew_complete_sub_arg 'bundle' 'edit' -l help -d 'Show this message' -__fish_brew_complete_sub_arg 'bundle' 'edit' -l install -d 'Run `install` before continuing to other operations, e.g. `exec`' +__fish_brew_complete_sub_arg 'bundle' 'edit' -l install -d 'Run `install` before editing the `Brewfile`' __fish_brew_complete_sub_arg 'bundle' 'edit' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l cargo -d '`list`, `dump` or `cleanup` Cargo packages' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l cask -d 'Add Homebrew cask entries' +__fish_brew_complete_sub_arg 'bundle' 'edit' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l cargo -d 'Dump Cargo packages' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l cask -d 'Dump Homebrew cask dependencies' __fish_brew_complete_sub_arg 'bundle' 'dump' -l debug -d 'Display any debugging information' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l describe -d '`dump` and `add` add a description comment above each line, unless the dependency does not have a description. Enabled by default if `$HOMEBREW_BUNDLE_DESCRIBE` is set' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l describe -d 'Add a description comment above each line, unless the dependency does not have a description. Enabled by default if `$HOMEBREW_BUNDLE_DESCRIBE` is set' __fish_brew_complete_sub_arg 'bundle' 'dump' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l flatpak -d '`list`, `dump` or `cleanup` Flatpak packages. Note: Linux only' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l force -d '`install` runs with `--force`/`--overwrite`. `dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l formula -d 'Add Homebrew formula entries' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l flatpak -d 'Dump Flatpak packages. Note: Linux only' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l force -d 'Overwrite an existing `Brewfile`' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l formula -d 'Dump Homebrew formula dependencies' __fish_brew_complete_sub_arg 'bundle' 'dump' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l go -d '`list`, `dump` or `cleanup` Go packages' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l go -d 'Dump Go packages' __fish_brew_complete_sub_arg 'bundle' 'dump' -l help -d 'Show this message' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l install -d 'Run `install` before continuing to other operations, e.g. `exec`' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l krew -d '`list` or `dump` Krew plugins' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l mas -d '`list` or `dump` Mac App Store dependencies' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l install -d 'Run `install` before dumping dependencies' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l krew -d 'Dump Krew plugins' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l mas -d 'Dump Mac App Store dependencies' __fish_brew_complete_sub_arg 'bundle' 'dump' -l no-cargo -d '`dump` without Cargo packages. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_CARGO` is set' __fish_brew_complete_sub_arg 'bundle' 'dump' -l no-flatpak -d '`dump` without Flatpak packages. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_FLATPAK` is set' __fish_brew_complete_sub_arg 'bundle' 'dump' -l no-go -d '`dump` without Go packages. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_GO` is set' __fish_brew_complete_sub_arg 'bundle' 'dump' -l no-krew -d '`dump` without Krew plugins. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_KREW` is set' __fish_brew_complete_sub_arg 'bundle' 'dump' -l no-npm -d '`dump` without npm packages. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_NPM` is set' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l no-restart -d '`dump` does not add `restart_service` to formula lines' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l no-restart -d 'Do not add `restart_service` to formula lines' __fish_brew_complete_sub_arg 'bundle' 'dump' -l no-uv -d '`dump` without uv tools. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_UV` is set' __fish_brew_complete_sub_arg 'bundle' 'dump' -l no-vscode -d '`dump` without VSCode (and forks/variants) extensions. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l npm -d '`list`, `dump` or `cleanup` npm packages' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l npm -d 'Dump npm packages' __fish_brew_complete_sub_arg 'bundle' 'dump' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l tap -d 'Add Homebrew tap entries' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l uv -d '`list`, `dump` or `cleanup` uv tools' -__fish_brew_complete_sub_arg 'bundle' 'dump' -l vscode -d '`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions' -__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l cargo -d '`list`, `dump` or `cleanup` Cargo packages' -__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l cask -d 'Add Homebrew cask entries' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l tap -d 'Dump Homebrew tap dependencies' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l uv -d 'Dump uv tools' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_sub_arg 'bundle' 'dump' -l vscode -d 'Dump VSCode (and forks/variants) extensions' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l cargo -d 'Clean up Cargo packages' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l cask -d 'Clean up Homebrew cask dependencies' __fish_brew_complete_sub_arg 'bundle' 'cleanup' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'bundle' 'cleanup' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' -__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l flatpak -d '`list`, `dump` or `cleanup` Flatpak packages. Note: Linux only' -__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l force -d '`install` runs with `--force`/`--overwrite`. `dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations' -__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l formula -d 'Add Homebrew formula entries' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l flatpak -d 'Clean up Flatpak packages. Note: Linux only' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l force -d 'Actually perform cleanup operations' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l formula -d 'Clean up Homebrew formula dependencies' __fish_brew_complete_sub_arg 'bundle' 'cleanup' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' -__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l go -d '`list`, `dump` or `cleanup` Go packages' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l go -d 'Clean up Go packages' __fish_brew_complete_sub_arg 'bundle' 'cleanup' -l help -d 'Show this message' -__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l install -d 'Run `install` before continuing to other operations, e.g. `exec`' -__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l npm -d '`list`, `dump` or `cleanup` npm packages' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l install -d 'Run `install` before cleaning up dependencies' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l npm -d 'Clean up npm packages' __fish_brew_complete_sub_arg 'bundle' 'cleanup' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l tap -d 'Add Homebrew tap entries' -__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l uv -d '`list`, `dump` or `cleanup` uv tools' -__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l vscode -d '`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions' -__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l zap -d '`cleanup` casks using the `zap` command instead of `uninstall`' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l tap -d 'Clean up Homebrew tap dependencies' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l uv -d 'Clean up uv tools' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l vscode -d 'Clean up VSCode (and forks/variants) extensions' +__fish_brew_complete_sub_arg 'bundle' 'cleanup' -l zap -d 'Clean up casks using the `zap` command instead of `uninstall`' __fish_brew_complete_sub_arg 'bundle' 'check' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'bundle' 'check' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' __fish_brew_complete_sub_arg 'bundle' 'check' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' __fish_brew_complete_sub_arg 'bundle' 'check' -l help -d 'Show this message' -__fish_brew_complete_sub_arg 'bundle' 'check' -l install -d 'Run `install` before continuing to other operations, e.g. `exec`' -__fish_brew_complete_sub_arg 'bundle' 'check' -l no-upgrade -d '`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' +__fish_brew_complete_sub_arg 'bundle' 'check' -l install -d 'Run `install` before checking dependencies' +__fish_brew_complete_sub_arg 'bundle' 'check' -l no-upgrade -d 'Do not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' __fish_brew_complete_sub_arg 'bundle' 'check' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_sub_arg 'bundle' 'check' -l verbose -d '`install` prints output from commands as they are run. `check` lists all missing dependencies' -__fish_brew_complete_sub_arg 'bundle' 'add' -l cargo -d '`list`, `dump` or `cleanup` Cargo packages' +__fish_brew_complete_sub_arg 'bundle' 'check' -l verbose -d 'List all missing dependencies' +__fish_brew_complete_sub_arg 'bundle' 'add' -l cargo -d 'Add entries for Cargo packages' __fish_brew_complete_sub_arg 'bundle' 'add' -l cask -d 'Add Homebrew cask entries' __fish_brew_complete_sub_arg 'bundle' 'add' -l debug -d 'Display any debugging information' -__fish_brew_complete_sub_arg 'bundle' 'add' -l describe -d '`dump` and `add` add a description comment above each line, unless the dependency does not have a description. Enabled by default if `$HOMEBREW_BUNDLE_DESCRIBE` is set' +__fish_brew_complete_sub_arg 'bundle' 'add' -l describe -d 'Add a description comment above each line, unless the dependency does not have a description. Enabled by default if `$HOMEBREW_BUNDLE_DESCRIBE` is set' __fish_brew_complete_sub_arg 'bundle' 'add' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' -__fish_brew_complete_sub_arg 'bundle' 'add' -l flatpak -d '`list`, `dump` or `cleanup` Flatpak packages. Note: Linux only' +__fish_brew_complete_sub_arg 'bundle' 'add' -l flatpak -d 'Add entries for Flatpak packages. Note: Linux only' __fish_brew_complete_sub_arg 'bundle' 'add' -l formula -d 'Add Homebrew formula entries' __fish_brew_complete_sub_arg 'bundle' 'add' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' -__fish_brew_complete_sub_arg 'bundle' 'add' -l go -d '`list`, `dump` or `cleanup` Go packages' +__fish_brew_complete_sub_arg 'bundle' 'add' -l go -d 'Add entries for Go packages' __fish_brew_complete_sub_arg 'bundle' 'add' -l help -d 'Show this message' -__fish_brew_complete_sub_arg 'bundle' 'add' -l install -d 'Run `install` before continuing to other operations, e.g. `exec`' -__fish_brew_complete_sub_arg 'bundle' 'add' -l krew -d '`list` or `dump` Krew plugins' -__fish_brew_complete_sub_arg 'bundle' 'add' -l npm -d '`list`, `dump` or `cleanup` npm packages' +__fish_brew_complete_sub_arg 'bundle' 'add' -l install -d 'Run `install` before adding entries' +__fish_brew_complete_sub_arg 'bundle' 'add' -l krew -d 'Add entries for Krew plugins' +__fish_brew_complete_sub_arg 'bundle' 'add' -l npm -d 'Add entries for npm packages' __fish_brew_complete_sub_arg 'bundle' 'add' -l quiet -d 'Make some output more quiet' __fish_brew_complete_sub_arg 'bundle' 'add' -l tap -d 'Add Homebrew tap entries' -__fish_brew_complete_sub_arg 'bundle' 'add' -l uv -d '`list`, `dump` or `cleanup` uv tools' -__fish_brew_complete_sub_arg 'bundle' 'add' -l vscode -d '`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions' +__fish_brew_complete_sub_arg 'bundle' 'add' -l uv -d 'Add entries for uv tools' +__fish_brew_complete_sub_arg 'bundle' 'add' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_sub_arg 'bundle' 'add' -l vscode -d 'Add entries for VSCode (and forks/variants) extensions' __fish_brew_complete_cmd 'casks' 'List all locally installable casks including short names' @@ -1796,11 +1801,10 @@ __fish_brew_complete_sub_cmd 'services' 'cl' 'Remove all unused services' __fish_brew_complete_sub_cmd 'services' 'rm' 'Remove all unused services' __fish_brew_complete_arg 'services; and [ (count (__fish_brew_args)) = 1 ]' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'services; and [ (count (__fish_brew_args)) = 1 ]' -l help -d 'Show this message' -__fish_brew_complete_arg 'services; and [ (count (__fish_brew_args)) = 1 ]' -l json -d 'Output as JSON' __fish_brew_complete_arg 'services; and [ (count (__fish_brew_args)) = 1 ]' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'services; and [ (count (__fish_brew_args)) = 1 ]' -l sudo-service-user -d 'When run as root on macOS, run the service(s) as this user' __fish_brew_complete_arg 'services; and [ (count (__fish_brew_args)) = 1 ]' -l verbose -d 'Make some output more verbose' -__fish_brew_complete_sub_arg 'services' 'stop unload terminate term t u' -l all -d 'Run subcommand on all services' +__fish_brew_complete_sub_arg 'services' 'stop unload terminate term t u' -l all -d 'Stop all services and unregister them from launching at login (or boot), unless `--keep` is specified' __fish_brew_complete_sub_arg 'services' 'stop unload terminate term t u' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'services' 'stop unload terminate term t u' -l help -d 'Show this message' __fish_brew_complete_sub_arg 'services' 'stop unload terminate term t u' -l keep -d 'When stopped, don\'t unregister the service from launching at login (or boot)' @@ -1810,7 +1814,7 @@ __fish_brew_complete_sub_arg 'services' 'stop unload terminate term t u' -l quie __fish_brew_complete_sub_arg 'services' 'stop unload terminate term t u' -l sudo-service-user -d 'When run as root on macOS, run the service(s) as this user' __fish_brew_complete_sub_arg 'services' 'stop unload terminate term t u' -l verbose -d 'Make some output more verbose' __fish_brew_complete_sub_arg 'services' 'stop unload terminate term t u' -a '(__fish_brew_suggest_services)' -__fish_brew_complete_sub_arg 'services' 'start launch load s l' -l all -d 'Run subcommand on all services' +__fish_brew_complete_sub_arg 'services' 'start launch load s l' -l all -d 'Start all services and register them to launch at login (or boot)' __fish_brew_complete_sub_arg 'services' 'start launch load s l' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'services' 'start launch load s l' -l file -d 'Use the service file from this location to `start` the service' __fish_brew_complete_sub_arg 'services' 'start launch load s l' -l help -d 'Show this message' @@ -1818,15 +1822,15 @@ __fish_brew_complete_sub_arg 'services' 'start launch load s l' -l quiet -d 'Mak __fish_brew_complete_sub_arg 'services' 'start launch load s l' -l sudo-service-user -d 'When run as root on macOS, run the service(s) as this user' __fish_brew_complete_sub_arg 'services' 'start launch load s l' -l verbose -d 'Make some output more verbose' __fish_brew_complete_sub_arg 'services' 'start launch load s l' -a '(__fish_brew_suggest_services)' -__fish_brew_complete_sub_arg 'services' 'run' -l all -d 'Run subcommand on all services' +__fish_brew_complete_sub_arg 'services' 'run' -l all -d 'Run all services without registering them to launch at login (or boot)' __fish_brew_complete_sub_arg 'services' 'run' -l debug -d 'Display any debugging information' -__fish_brew_complete_sub_arg 'services' 'run' -l file -d 'Use the service file from this location to `start` the service' +__fish_brew_complete_sub_arg 'services' 'run' -l file -d 'Use the service file from this location to `run` the service' __fish_brew_complete_sub_arg 'services' 'run' -l help -d 'Show this message' __fish_brew_complete_sub_arg 'services' 'run' -l quiet -d 'Make some output more quiet' __fish_brew_complete_sub_arg 'services' 'run' -l sudo-service-user -d 'When run as root on macOS, run the service(s) as this user' __fish_brew_complete_sub_arg 'services' 'run' -l verbose -d 'Make some output more verbose' __fish_brew_complete_sub_arg 'services' 'run' -a '(__fish_brew_suggest_services)' -__fish_brew_complete_sub_arg 'services' 'restart relaunch reload r' -l all -d 'Run subcommand on all services' +__fish_brew_complete_sub_arg 'services' 'restart relaunch reload r' -l all -d 'Restart all services' __fish_brew_complete_sub_arg 'services' 'restart relaunch reload r' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'services' 'restart relaunch reload r' -l file -d 'Use the service file from this location to `start` the service' __fish_brew_complete_sub_arg 'services' 'restart relaunch reload r' -l help -d 'Show this message' @@ -1840,14 +1844,14 @@ __fish_brew_complete_sub_arg 'services' 'list ls' -l json -d 'Output as JSON' __fish_brew_complete_sub_arg 'services' 'list ls' -l quiet -d 'Make some output more quiet' __fish_brew_complete_sub_arg 'services' 'list ls' -l sudo-service-user -d 'When run as root on macOS, run the service(s) as this user' __fish_brew_complete_sub_arg 'services' 'list ls' -l verbose -d 'Make some output more verbose' -__fish_brew_complete_sub_arg 'services' 'kill k' -l all -d 'Run subcommand on all services' +__fish_brew_complete_sub_arg 'services' 'kill k' -l all -d 'Stop all services immediately but keep them registered to launch at login (or boot)' __fish_brew_complete_sub_arg 'services' 'kill k' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'services' 'kill k' -l help -d 'Show this message' __fish_brew_complete_sub_arg 'services' 'kill k' -l quiet -d 'Make some output more quiet' __fish_brew_complete_sub_arg 'services' 'kill k' -l sudo-service-user -d 'When run as root on macOS, run the service(s) as this user' __fish_brew_complete_sub_arg 'services' 'kill k' -l verbose -d 'Make some output more verbose' __fish_brew_complete_sub_arg 'services' 'kill k' -a '(__fish_brew_suggest_services)' -__fish_brew_complete_sub_arg 'services' 'info i' -l all -d 'Run subcommand on all services' +__fish_brew_complete_sub_arg 'services' 'info i' -l all -d 'List all managed services' __fish_brew_complete_sub_arg 'services' 'info i' -l debug -d 'Display any debugging information' __fish_brew_complete_sub_arg 'services' 'info i' -l help -d 'Show this message' __fish_brew_complete_sub_arg 'services' 'info i' -l json -d 'Output as JSON' diff --git a/completions/zsh/_brew b/completions/zsh/_brew index 2f063c904aeb4..bee1a1da1d473 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -735,18 +735,12 @@ _brew_bundle() { ) _arguments -C \ - '--cleanup[`install` performs cleanup operation, same as running `cleanup --force`. Enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` is passed]' \ '--debug[Display any debugging information]' \ '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ - '--force[`install` runs with `--force`/`--overwrite`. `dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ '--help[Show this message]' \ - '--jobs[`install` runs up to this many formula installations in parallel. Defaults to 1 (sequential). Use `auto` for the number of CPU cores (max 4)]' \ - '--no-upgrade[`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ '--quiet[Make some output more quiet]' \ - '--upgrade[`install` runs `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ - '--upgrade-formulae[`install` runs `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ - '--verbose[`install` prints output from commands as they are run. `check` lists all missing dependencies]' \ + '--verbose[Make some output more verbose]' \ '1:subcommand:->subcommand' \ '*::arg:->args' @@ -762,103 +756,110 @@ upgrade) '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ '--help[Show this message]' \ - '--jobs[`install` runs up to this many formula installations in parallel. Defaults to 1 (sequential). Use `auto` for the number of CPU cores (max 4)]' \ + '--jobs[Run up to this many formula installations in parallel. Defaults to 1 (sequential). Use `auto` for the number of CPU cores (max 4)]' \ '--quiet[Make some output more quiet]' \ - '--upgrade[`install` runs `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ - '--upgrade-formulae[`install` runs `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' + '--upgrade[Run `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ + '--upgrade-formulae[Run `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ + '--verbose[Make some output more verbose]' ;; sh) _arguments \ - '--check[Check that all dependencies in the Brewfile are installed before running `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set]' \ + '--check[Check that all dependencies in the Brewfile are installed before starting the shell. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set]' \ '--debug[Display any debugging information]' \ '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ '--help[Show this message]' \ - '--install[Run `install` before continuing to other operations, e.g. `exec`]' \ - '--no-secrets[Attempt to remove secrets from the environment before `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set]' \ + '--install[Run `install` before starting the shell]' \ + '--no-secrets[Attempt to remove secrets from the environment before starting the shell. Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set]' \ '--quiet[Make some output more quiet]' \ - '--services[Temporarily start services while running the `exec` or `sh` command. Enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set]' + '--services[Temporarily start services while running the shell. Enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set]' \ + '--verbose[Make some output more verbose]' ;; remove) _arguments \ - '(--no-cargo)--cargo[`list`, `dump` or `cleanup` Cargo packages]' \ - '--cask[Add Homebrew cask entries]' \ + '(--no-cargo)--cargo[Remove entries for Cargo packages]' \ + '--cask[Remove Homebrew cask entries]' \ '--debug[Display any debugging information]' \ '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ - '(--no-flatpak)--flatpak[`list`, `dump` or `cleanup` Flatpak packages. Note: Linux only]' \ - '--formula[Add Homebrew formula entries]' \ + '(--no-flatpak)--flatpak[Remove entries for Flatpak packages. Note: Linux only]' \ + '--formula[Remove Homebrew formula entries, including matches against formula aliases and old names]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ - '(--no-go)--go[`list`, `dump` or `cleanup` Go packages]' \ + '(--no-go)--go[Remove entries for Go packages]' \ '--help[Show this message]' \ - '--install[Run `install` before continuing to other operations, e.g. `exec`]' \ - '(--no-krew)--krew[`list` or `dump` Krew plugins]' \ - '--mas[`list` or `dump` Mac App Store dependencies]' \ - '(--no-npm)--npm[`list`, `dump` or `cleanup` npm packages]' \ + '--install[Run `install` before removing entries]' \ + '(--no-krew)--krew[Remove entries for Krew plugins]' \ + '--mas[Remove entries for Mac App Store dependencies]' \ + '(--no-npm)--npm[Remove entries for npm packages]' \ '--quiet[Make some output more quiet]' \ - '--tap[Add Homebrew tap entries]' \ - '(--no-uv)--uv[`list`, `dump` or `cleanup` uv tools]' \ - '(--no-vscode)--vscode[`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions]' + '--tap[Remove Homebrew tap entries]' \ + '(--no-uv)--uv[Remove entries for uv tools]' \ + '--verbose[Make some output more verbose]' \ + '(--no-vscode)--vscode[Remove entries for VSCode (and forks/variants) extensions]' ;; list) _arguments \ - '--all[`list` all dependencies]' \ - '(--no-cargo)--cargo[`list`, `dump` or `cleanup` Cargo packages]' \ - '--cask[Add Homebrew cask entries]' \ + '--all[List all dependencies]' \ + '(--no-cargo)--cargo[List Cargo packages]' \ + '--cask[List Homebrew cask dependencies]' \ '--debug[Display any debugging information]' \ '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ - '(--no-flatpak)--flatpak[`list`, `dump` or `cleanup` Flatpak packages. Note: Linux only]' \ - '--formula[Add Homebrew formula entries]' \ + '(--no-flatpak)--flatpak[List Flatpak packages. Note: Linux only]' \ + '--formula[List Homebrew formula dependencies]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ - '(--no-go)--go[`list`, `dump` or `cleanup` Go packages]' \ + '(--no-go)--go[List Go packages]' \ '--help[Show this message]' \ - '--install[Run `install` before continuing to other operations, e.g. `exec`]' \ - '(--no-krew)--krew[`list` or `dump` Krew plugins]' \ - '--mas[`list` or `dump` Mac App Store dependencies]' \ - '(--no-npm)--npm[`list`, `dump` or `cleanup` npm packages]' \ + '--install[Run `install` before listing dependencies]' \ + '(--no-krew)--krew[List Krew plugins]' \ + '--mas[List Mac App Store dependencies]' \ + '(--no-npm)--npm[List npm packages]' \ '--quiet[Make some output more quiet]' \ - '--tap[Add Homebrew tap entries]' \ - '(--no-uv)--uv[`list`, `dump` or `cleanup` uv tools]' \ - '(--no-vscode)--vscode[`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions]' + '--tap[List Homebrew tap dependencies]' \ + '(--no-uv)--uv[List uv tools]' \ + '--verbose[Make some output more verbose]' \ + '(--no-vscode)--vscode[List VSCode (and forks/variants) extensions]' ;; install) _arguments \ - '--cleanup[`install` performs cleanup operation, same as running `cleanup --force`. Enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` is passed]' \ + '--cleanup[Perform cleanup after installing dependencies, same as running `cleanup --force`. Enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` is passed]' \ '--debug[Display any debugging information]' \ '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ - '--force[`install` runs with `--force`/`--overwrite`. `dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations]' \ + '--force[Run with `--force`/`--overwrite`]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ '--help[Show this message]' \ - '--jobs[`install` runs up to this many formula installations in parallel. Defaults to 1 (sequential). Use `auto` for the number of CPU cores (max 4)]' \ - '--no-upgrade[`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ + '--jobs[Run up to this many formula installations in parallel. Defaults to 1 (sequential). Use `auto` for the number of CPU cores (max 4)]' \ + '--no-upgrade[Do not run `brew upgrade` on outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ '--quiet[Make some output more quiet]' \ - '--upgrade[`install` runs `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ - '--upgrade-formulae[`install` runs `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ - '--verbose[`install` prints output from commands as they are run. `check` lists all missing dependencies]' + '--upgrade[Run `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ + '--upgrade-formulae[Run `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ + '--verbose[Print output from commands as they are run]' \ + '--zap[Use `zap` instead of `uninstall` when cleaning up casks after installing dependencies]' ;; exec) _arguments \ - '--check[Check that all dependencies in the Brewfile are installed before running `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set]' \ + '--check[Check that all dependencies in the Brewfile are installed before executing the command. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set]' \ '--debug[Display any debugging information]' \ '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ '--help[Show this message]' \ - '--install[Run `install` before continuing to other operations, e.g. `exec`]' \ - '--no-secrets[Attempt to remove secrets from the environment before `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set]' \ + '--install[Run `install` before executing the command]' \ + '--no-secrets[Attempt to remove secrets from the environment before executing the command. Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set]' \ '--quiet[Make some output more quiet]' \ - '--services[Temporarily start services while running the `exec` or `sh` command. Enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set]' \ + '--services[Temporarily start services while executing the command. Enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set]' \ + '--verbose[Make some output more verbose]' \ - command \ '*:command:__brew_commands' ;; env) _arguments \ - '--check[Check that all dependencies in the Brewfile are installed before running `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set]' \ + '--check[Check that all dependencies in the Brewfile are installed before printing the environment. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set]' \ '--debug[Display any debugging information]' \ '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ '--help[Show this message]' \ - '--install[Run `install` before continuing to other operations, e.g. `exec`]' \ - '--no-secrets[Attempt to remove secrets from the environment before `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set]' \ - '--quiet[Make some output more quiet]' + '--install[Run `install` before printing the environment]' \ + '--no-secrets[Attempt to remove secrets from the environment before printing it. Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set]' \ + '--quiet[Make some output more quiet]' \ + '--verbose[Make some output more verbose]' ;; edit) _arguments \ @@ -866,58 +867,61 @@ edit) '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ '--help[Show this message]' \ - '--install[Run `install` before continuing to other operations, e.g. `exec`]' \ - '--quiet[Make some output more quiet]' + '--install[Run `install` before editing the `Brewfile`]' \ + '--quiet[Make some output more quiet]' \ + '--verbose[Make some output more verbose]' ;; dump) _arguments \ - '(--no-cargo)--cargo[`list`, `dump` or `cleanup` Cargo packages]' \ - '--cask[Add Homebrew cask entries]' \ + '(--no-cargo)--cargo[Dump Cargo packages]' \ + '--cask[Dump Homebrew cask dependencies]' \ '--debug[Display any debugging information]' \ - '--describe[`dump` and `add` add a description comment above each line, unless the dependency does not have a description. Enabled by default if `$HOMEBREW_BUNDLE_DESCRIBE` is set]' \ + '--describe[Add a description comment above each line, unless the dependency does not have a description. Enabled by default if `$HOMEBREW_BUNDLE_DESCRIBE` is set]' \ '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ - '(--no-flatpak)--flatpak[`list`, `dump` or `cleanup` Flatpak packages. Note: Linux only]' \ - '--force[`install` runs with `--force`/`--overwrite`. `dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations]' \ - '--formula[Add Homebrew formula entries]' \ + '(--no-flatpak)--flatpak[Dump Flatpak packages. Note: Linux only]' \ + '--force[Overwrite an existing `Brewfile`]' \ + '--formula[Dump Homebrew formula dependencies]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ - '(--no-go)--go[`list`, `dump` or `cleanup` Go packages]' \ + '(--no-go)--go[Dump Go packages]' \ '--help[Show this message]' \ - '--install[Run `install` before continuing to other operations, e.g. `exec`]' \ - '(--no-krew)--krew[`list` or `dump` Krew plugins]' \ - '--mas[`list` or `dump` Mac App Store dependencies]' \ + '--install[Run `install` before dumping dependencies]' \ + '(--no-krew)--krew[Dump Krew plugins]' \ + '--mas[Dump Mac App Store dependencies]' \ '(--cargo)--no-cargo[`dump` without Cargo packages. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_CARGO` is set]' \ '(--flatpak)--no-flatpak[`dump` without Flatpak packages. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_FLATPAK` is set]' \ '(--go)--no-go[`dump` without Go packages. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_GO` is set]' \ '(--krew)--no-krew[`dump` without Krew plugins. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_KREW` is set]' \ '(--npm)--no-npm[`dump` without npm packages. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_NPM` is set]' \ - '--no-restart[`dump` does not add `restart_service` to formula lines]' \ + '--no-restart[Do not add `restart_service` to formula lines]' \ '(--uv)--no-uv[`dump` without uv tools. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_UV` is set]' \ '(--vscode)--no-vscode[`dump` without VSCode (and forks/variants) extensions. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set]' \ - '(--no-npm)--npm[`list`, `dump` or `cleanup` npm packages]' \ + '(--no-npm)--npm[Dump npm packages]' \ '--quiet[Make some output more quiet]' \ - '--tap[Add Homebrew tap entries]' \ - '(--no-uv)--uv[`list`, `dump` or `cleanup` uv tools]' \ - '(--no-vscode)--vscode[`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions]' + '--tap[Dump Homebrew tap dependencies]' \ + '(--no-uv)--uv[Dump uv tools]' \ + '--verbose[Make some output more verbose]' \ + '(--no-vscode)--vscode[Dump VSCode (and forks/variants) extensions]' ;; cleanup) _arguments \ - '(--no-cargo)--cargo[`list`, `dump` or `cleanup` Cargo packages]' \ - '--cask[Add Homebrew cask entries]' \ + '(--no-cargo)--cargo[Clean up Cargo packages]' \ + '--cask[Clean up Homebrew cask dependencies]' \ '--debug[Display any debugging information]' \ '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ - '(--no-flatpak)--flatpak[`list`, `dump` or `cleanup` Flatpak packages. Note: Linux only]' \ - '--force[`install` runs with `--force`/`--overwrite`. `dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations]' \ - '--formula[Add Homebrew formula entries]' \ + '(--no-flatpak)--flatpak[Clean up Flatpak packages. Note: Linux only]' \ + '--force[Actually perform cleanup operations]' \ + '--formula[Clean up Homebrew formula dependencies]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ - '(--no-go)--go[`list`, `dump` or `cleanup` Go packages]' \ + '(--no-go)--go[Clean up Go packages]' \ '--help[Show this message]' \ - '--install[Run `install` before continuing to other operations, e.g. `exec`]' \ - '(--no-npm)--npm[`list`, `dump` or `cleanup` npm packages]' \ + '--install[Run `install` before cleaning up dependencies]' \ + '(--no-npm)--npm[Clean up npm packages]' \ '--quiet[Make some output more quiet]' \ - '--tap[Add Homebrew tap entries]' \ - '(--no-uv)--uv[`list`, `dump` or `cleanup` uv tools]' \ - '(--no-vscode)--vscode[`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions]' \ - '--zap[`cleanup` casks using the `zap` command instead of `uninstall`]' + '--tap[Clean up Homebrew tap dependencies]' \ + '(--no-uv)--uv[Clean up uv tools]' \ + '--verbose[Make some output more verbose]' \ + '(--no-vscode)--vscode[Clean up VSCode (and forks/variants) extensions]' \ + '--zap[Clean up casks using the `zap` command instead of `uninstall`]' ;; check) _arguments \ @@ -925,30 +929,31 @@ check) '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ '--help[Show this message]' \ - '--install[Run `install` before continuing to other operations, e.g. `exec`]' \ - '--no-upgrade[`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ + '--install[Run `install` before checking dependencies]' \ + '--no-upgrade[Do not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ '--quiet[Make some output more quiet]' \ - '--verbose[`install` prints output from commands as they are run. `check` lists all missing dependencies]' + '--verbose[List all missing dependencies]' ;; add) _arguments \ - '(--no-cargo)--cargo[`list`, `dump` or `cleanup` Cargo packages]' \ + '(--no-cargo)--cargo[Add entries for Cargo packages]' \ '--cask[Add Homebrew cask entries]' \ '--debug[Display any debugging information]' \ - '--describe[`dump` and `add` add a description comment above each line, unless the dependency does not have a description. Enabled by default if `$HOMEBREW_BUNDLE_DESCRIBE` is set]' \ + '--describe[Add a description comment above each line, unless the dependency does not have a description. Enabled by default if `$HOMEBREW_BUNDLE_DESCRIBE` is set]' \ '(--global)--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ - '(--no-flatpak)--flatpak[`list`, `dump` or `cleanup` Flatpak packages. Note: Linux only]' \ + '(--no-flatpak)--flatpak[Add entries for Flatpak packages. Note: Linux only]' \ '--formula[Add Homebrew formula entries]' \ '(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ - '(--no-go)--go[`list`, `dump` or `cleanup` Go packages]' \ + '(--no-go)--go[Add entries for Go packages]' \ '--help[Show this message]' \ - '--install[Run `install` before continuing to other operations, e.g. `exec`]' \ - '(--no-krew)--krew[`list` or `dump` Krew plugins]' \ - '(--no-npm)--npm[`list`, `dump` or `cleanup` npm packages]' \ + '--install[Run `install` before adding entries]' \ + '(--no-krew)--krew[Add entries for Krew plugins]' \ + '(--no-npm)--npm[Add entries for npm packages]' \ '--quiet[Make some output more quiet]' \ '--tap[Add Homebrew tap entries]' \ - '(--no-uv)--uv[`list`, `dump` or `cleanup` uv tools]' \ - '(--no-vscode)--vscode[`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions]' + '(--no-uv)--uv[Add entries for uv tools]' \ + '--verbose[Make some output more verbose]' \ + '(--no-vscode)--vscode[Add entries for VSCode (and forks/variants) extensions]' ;; *) ;; esac @@ -2326,7 +2331,6 @@ _brew_services() { _arguments -C \ '--debug[Display any debugging information]' \ '--help[Show this message]' \ - '--json[Output as JSON]' \ '--quiet[Make some output more quiet]' \ '--sudo-service-user[When run as root on macOS, run the service(s) as this user]' \ '--verbose[Make some output more verbose]' \ @@ -2341,7 +2345,7 @@ _brew_services() { case "$words[2]" in stop|unload|terminate|term|t|u) _arguments \ - '(--file)--all[Run subcommand on all services]' \ + '(--file)--all[Stop all services and unregister them from launching at login (or boot), unless `--keep` is specified]' \ '--debug[Display any debugging information]' \ '--help[Show this message]' \ '--keep[When stopped, don'\''t unregister the service from launching at login (or boot)]' \ @@ -2355,7 +2359,7 @@ stop|unload|terminate|term|t|u) ;; start|launch|load|s|l) _arguments \ - '(--file)--all[Run subcommand on all services]' \ + '(--file)--all[Start all services and register them to launch at login (or boot)]' \ '--debug[Display any debugging information]' \ '(--all)--file[Use the service file from this location to `start` the service]' \ '--help[Show this message]' \ @@ -2367,9 +2371,9 @@ start|launch|load|s|l) ;; run) _arguments \ - '(--file)--all[Run subcommand on all services]' \ + '(--file)--all[Run all services without registering them to launch at login (or boot)]' \ '--debug[Display any debugging information]' \ - '(--all)--file[Use the service file from this location to `start` the service]' \ + '(--all)--file[Use the service file from this location to `run` the service]' \ '--help[Show this message]' \ '--quiet[Make some output more quiet]' \ '--sudo-service-user[When run as root on macOS, run the service(s) as this user]' \ @@ -2379,7 +2383,7 @@ run) ;; restart|relaunch|reload|r) _arguments \ - '(--file)--all[Run subcommand on all services]' \ + '(--file)--all[Restart all services]' \ '--debug[Display any debugging information]' \ '(--all)--file[Use the service file from this location to `start` the service]' \ '--help[Show this message]' \ @@ -2400,7 +2404,7 @@ list|ls) ;; kill|k) _arguments \ - '(--file)--all[Run subcommand on all services]' \ + '(--file)--all[Stop all services immediately but keep them registered to launch at login (or boot)]' \ '--debug[Display any debugging information]' \ '--help[Show this message]' \ '--quiet[Make some output more quiet]' \ @@ -2411,7 +2415,7 @@ kill|k) ;; info|i) _arguments \ - '(--file)--all[Run subcommand on all services]' \ + '(--file)--all[List all managed services]' \ '--debug[Display any debugging information]' \ '--help[Show this message]' \ '--json[Output as JSON]' \ diff --git a/docs/Manpage.md b/docs/Manpage.md index 3513ba1db1886..51fc5d1e7742c 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -150,14 +150,59 @@ packages, uv tools, Flatpak packages, Krew plugins and npm packages. Note: Flatpak support is only available on Linux. +`--file` + +: Read from or write to the `Brewfile` from this location. Use `--file=-` to + pipe to stdin/stdout. + +`-g`, `--global` + +: Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if + set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), + `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise. + `brew bundle upgrade` : Shorthand for `brew bundle install --upgrade`. +`--upgrade` + +: Run `brew upgrade` on outdated dependencies, even if + `$HOMEBREW_BUNDLE_NO_UPGRADE` is set. + +`--upgrade-formulae` + +: Run `brew upgrade` on any of these comma-separated formulae, even if + `$HOMEBREW_BUNDLE_NO_UPGRADE` is set. + +`--jobs` + +: Run up to this many formula installations in parallel. Defaults to 1 + (sequential). Use `auto` for the number of CPU cores (max 4). + `brew bundle sh` \[`--check`\] \[`--no-secrets`\] : Run your shell in a `brew bundle exec` environment. +`--install` + +: Run `install` before starting the shell. + +`--services` + +: Temporarily start services while running the shell. Enabled by default if + `$HOMEBREW_BUNDLE_SERVICES` is set. + +`--check` + +: Check that all dependencies in the Brewfile are installed before starting the + shell. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set. + +`--no-secrets` + +: Attempt to remove secrets from the environment before starting the shell. + Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set. + `brew bundle remove` *`name`* \[...\] : Remove entries that match `name` from your `Brewfile`. Use `--formula`, @@ -166,12 +211,113 @@ Note: Flatpak support is only available on Linux. type. Passing `--formula` also removes matches against formula aliases and old formula names. +`--install` + +: Run `install` before removing entries. + +`--formula` + +: Remove Homebrew formula entries, including matches against formula aliases and + old names. + +`--cask` + +: Remove Homebrew cask entries. + +`--tap` + +: Remove Homebrew tap entries. + +`--mas` + +: Remove entries for Mac App Store dependencies. + +`--vscode` + +: Remove entries for VSCode (and forks/variants) extensions. + +`--go` + +: Remove entries for Go packages. + +`--cargo` + +: Remove entries for Cargo packages. + +`--uv` + +: Remove entries for uv tools. + +`--flatpak` + +: Remove entries for Flatpak packages. Note: Linux only. + +`--krew` + +: Remove entries for Krew plugins. + +`--npm` + +: Remove entries for npm packages. + `brew bundle list` : List all dependencies present in the `Brewfile`. By default, only Homebrew formula dependencies are listed. +`--install` + +: Run `install` before listing dependencies. + +`--all` + +: List all dependencies. + +`--formula` + +: List Homebrew formula dependencies. + +`--cask` + +: List Homebrew cask dependencies. + +`--tap` + +: List Homebrew tap dependencies. + +`--mas` + +: List Mac App Store dependencies. + +`--vscode` + +: List VSCode (and forks/variants) extensions. + +`--go` + +: List Go packages. + +`--cargo` + +: List Cargo packages. + +`--uv` + +: List uv tools. + +`--flatpak` + +: List Flatpak packages. Note: Linux only. + +`--krew` + +: List Krew plugins. + +`--npm` + +: List npm packages. + `brew bundle` \[`install`\] : Install and upgrade (by default) all dependencies from the `Brewfile`. @@ -186,6 +332,46 @@ to one or more of the following environment variables: `$HOMEBREW_BUNDLE_BREW_SKIP`, `$HOMEBREW_BUNDLE_CASK_SKIP`, `$HOMEBREW_BUNDLE_MAS_SKIP`, `$HOMEBREW_BUNDLE_TAP_SKIP`. +`-v`, `--verbose` + +: Print output from commands as they are run. + +`--no-upgrade` + +: Do not run `brew upgrade` on outdated dependencies. Note they may still be + upgraded by `brew install` if needed. Enabled by default if + `$HOMEBREW_BUNDLE_NO_UPGRADE` is set. + +`--upgrade` + +: Run `brew upgrade` on outdated dependencies, even if + `$HOMEBREW_BUNDLE_NO_UPGRADE` is set. + +`--upgrade-formulae` + +: Run `brew upgrade` on any of these comma-separated formulae, even if + `$HOMEBREW_BUNDLE_NO_UPGRADE` is set. + +`--jobs` + +: Run up to this many formula installations in parallel. Defaults to 1 + (sequential). Use `auto` for the number of CPU cores (max 4). + +`-f`, `--force` + +: Run with `--force`/`--overwrite`. + +`--cleanup` + +: Perform cleanup after installing dependencies, same as running `cleanup + --force`. Enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and + `--global` is passed. + +`--zap` + +: Use `zap` instead of `uninstall` when cleaning up casks after installing + dependencies. + `brew bundle exec` \[`--check`\] \[`--no-secrets`\] *`command`* : Run an external command in an isolated build environment based on the @@ -197,15 +383,52 @@ commands like `bundle install`, `npm install`, etc. It will also add compiler flags which will help with finding keg-only dependencies like `openssl`, `icu4c`, etc. +`--install` + +: Run `install` before executing the command. + +`--services` + +: Temporarily start services while executing the command. Enabled by default if + `$HOMEBREW_BUNDLE_SERVICES` is set. + +`--check` + +: Check that all dependencies in the Brewfile are installed before executing the + command. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set. + +`--no-secrets` + +: Attempt to remove secrets from the environment before executing the command. + Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set. + `brew bundle env` \[`--check`\] \[`--no-secrets`\] : Print the environment variables that would be set in a `brew bundle exec` environment. +`--install` + +: Run `install` before printing the environment. + +`--check` + +: Check that all dependencies in the Brewfile are installed before printing the + environment. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set. + +`--no-secrets` + +: Attempt to remove secrets from the environment before printing it. Enabled by + default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set. + `brew bundle edit` : Edit the `Brewfile` in your editor. +`--install` + +: Run `install` before editing the `Brewfile`. + `brew bundle dump` : Write all installed casks/formulae/images/taps into a `Brewfile` in the @@ -213,83 +436,57 @@ flags which will help with finding keg-only dependencies like `openssl`, is useful as an installed-state snapshot and can be kept in version control and diffed. -`brew bundle cleanup` - -: Uninstall all dependencies not present in the `Brewfile`. - -This workflow is useful for maintainers or testers who regularly install lots of -formulae. - -Unless `--force` is passed, this returns a 1 exit code if anything would be -removed. +`--install` -`brew bundle check` +: Run `install` before dumping dependencies. -: Check if all dependencies present in the `Brewfile` are installed. - -This provides a successful exit code if everything is up-to-date, making it -useful for scripting. Use `--verbose` to list unmet dependencies. +`-f`, `--force` -`brew bundle add` *`name`* \[...\] +: Overwrite an existing `Brewfile`. -: Add entries to your `Brewfile`. Adds formulae by default. Use `--cask`, - `--tap`, `--vscode`, `--go`, `--cargo`, `--uv`, `--flatpak`, `--krew` and - `--npm` to add the corresponding entry instead. - -`--file` +`--formula` -: Read from or write to the `Brewfile` from this location. Use `--file=-` to - pipe to stdin/stdout. +: Dump Homebrew formula dependencies. -`-g`, `--global` +`--cask` -: Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if - set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), - `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise. +: Dump Homebrew cask dependencies. -`--all` +`--tap` -: `list` all dependencies. +: Dump Homebrew tap dependencies. -`--upgrade` +`--mas` -: `install` runs `brew upgrade` on outdated dependencies, even if - `$HOMEBREW_BUNDLE_NO_UPGRADE` is set. +: Dump Mac App Store dependencies. -`--upgrade-formulae` +`--vscode` -: `install` runs `brew upgrade` on any of these comma-separated formulae, even - if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set. +: Dump VSCode (and forks/variants) extensions. -`--jobs` +`--go` -: `install` runs up to this many formula installations in parallel. Defaults to - 1 (sequential). Use `auto` for the number of CPU cores (max 4). +: Dump Go packages. -`--cleanup` +`--cargo` -: `install` performs cleanup operation, same as running `cleanup --force`. - Enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` - is passed. +: Dump Cargo packages. -`--services` +`--uv` -: Temporarily start services while running the `exec` or `sh` command. Enabled - by default if `$HOMEBREW_BUNDLE_SERVICES` is set. +: Dump uv tools. -`--check` +`--flatpak` -: Check that all dependencies in the Brewfile are installed before running - `exec`, `sh`, or `env`. Enabled by default if `$HOMEBREW_BUNDLE_CHECK` is set. +: Dump Flatpak packages. Note: Linux only. -`--no-secrets` +`--krew` -: Attempt to remove secrets from the environment before `exec`, `sh`, or `env`. - Enabled by default if `$HOMEBREW_BUNDLE_NO_SECRETS` is set. +: Dump Krew plugins. -`--mas` +`--npm` -: `list` or `dump` Mac App Store dependencies. +: Dump npm packages. `--no-vscode` @@ -326,34 +523,103 @@ useful for scripting. Use `--verbose` to list unmet dependencies. : `dump` without npm packages. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_NPM` is set. +`--describe` + +: Add a description comment above each line, unless the dependency does not have + a description. Enabled by default if `$HOMEBREW_BUNDLE_DESCRIBE` is set. + `--no-restart` -: `dump` does not add `restart_service` to formula lines. +: Do not add `restart_service` to formula lines. + +`brew bundle cleanup` + +: Uninstall all dependencies not present in the `Brewfile`. + +This workflow is useful for maintainers or testers who regularly install lots of +formulae. + +Unless `--force` is passed, this returns a 1 exit code if anything would be +removed. + +`--install` + +: Run `install` before cleaning up dependencies. `-f`, `--force` -: `install` runs with `--force`/`--overwrite`. `dump` overwrites an existing - `Brewfile`. `cleanup` actually performs its cleanup operations. +: Actually perform cleanup operations. + +`--formula` + +: Clean up Homebrew formula dependencies. + +`--cask` + +: Clean up Homebrew cask dependencies. + +`--tap` + +: Clean up Homebrew tap dependencies. + +`--vscode` + +: Clean up VSCode (and forks/variants) extensions. + +`--go` + +: Clean up Go packages. + +`--cargo` + +: Clean up Cargo packages. + +`--uv` + +: Clean up uv tools. + +`--flatpak` + +: Clean up Flatpak packages. Note: Linux only. + +`--npm` + +: Clean up npm packages. `--zap` -: `cleanup` casks using the `zap` command instead of `uninstall`. +: Clean up casks using the `zap` command instead of `uninstall`. + +`brew bundle check` + +: Check if all dependencies present in the `Brewfile` are installed. + +This provides a successful exit code if everything is up-to-date, making it +useful for scripting. Use `--verbose` to list unmet dependencies. `-v`, `--verbose` -: `install` prints output from commands as they are run. `check` lists all - missing dependencies. +: List all missing dependencies. `--no-upgrade` -: `install` does not run `brew upgrade` on outdated dependencies. `check` does - not check for outdated dependencies. Note they may still be upgraded by `brew - install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is - set. +: Do not check for outdated dependencies. Note they may still be upgraded by + `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` + is set. `--install` -: Run `install` before continuing to other operations, e.g. `exec`. +: Run `install` before checking dependencies. + +`brew bundle add` *`name`* \[...\] + +: Add entries to your `Brewfile`. Adds formulae by default. Use `--cask`, + `--tap`, `--vscode`, `--go`, `--cargo`, `--uv`, `--flatpak`, `--krew` and + `--npm` to add the corresponding entry instead. + +`--install` + +: Run `install` before adding entries. `--formula` @@ -369,37 +635,36 @@ useful for scripting. Use `--verbose` to list unmet dependencies. `--vscode` -: `list`, `dump` or `cleanup` VSCode (and forks/variants) extensions. +: Add entries for VSCode (and forks/variants) extensions. `--go` -: `list`, `dump` or `cleanup` Go packages. +: Add entries for Go packages. `--cargo` -: `list`, `dump` or `cleanup` Cargo packages. +: Add entries for Cargo packages. `--uv` -: `list`, `dump` or `cleanup` uv tools. +: Add entries for uv tools. `--flatpak` -: `list`, `dump` or `cleanup` Flatpak packages. Note: Linux only. +: Add entries for Flatpak packages. Note: Linux only. `--krew` -: `list` or `dump` Krew plugins. +: Add entries for Krew plugins. `--npm` -: `list`, `dump` or `cleanup` npm packages. +: Add entries for npm packages. `--describe` -: `dump` and `add` add a description comment above each line, unless the - dependency does not have a description. Enabled by default if - `$HOMEBREW_BUNDLE_DESCRIBE` is set. +: Add a description comment above each line, unless the dependency does not have + a description. Enabled by default if `$HOMEBREW_BUNDLE_DESCRIBE` is set. ### `casks` @@ -1530,73 +1795,107 @@ If `sudo` is passed, operate on `/Library/LaunchDaemons` or `/usr/lib/systemd/system` (started at boot). Otherwise, operate on `~/Library/LaunchAgents` or `~/.config/systemd/user` (started at login). +`--sudo-service-user` + +: When run as root on macOS, run the service(s) as this user. + \[`sudo`\] `brew services stop` \[`--keep`\] \[`--no-wait`\|`--max-wait=`\] (*`formula`*\|`--all`) : Stop the service *`formula`* immediately and unregister it from launching at login (or boot), unless `--keep` is specified. +`--max-wait` + +: Wait at most this many seconds for `stop` to finish stopping a service. + Defaults to 60. Set this to zero (0) seconds to wait indefinitely. + +`--no-wait` + +: Don't wait for `stop` to finish stopping the service. + +`--keep` + +: When stopped, don't unregister the service from launching at login (or boot). + +`--all` + +: Stop all services and unregister them from launching at login (or boot), + unless `--keep` is specified. + \[`sudo`\] `brew services start` (*`formula`*\|`--all`) \[`--file=`\] : Start the service *`formula`* immediately and register it to launch at login (or boot). +`--file` + +: Use the service file from this location to `start` the service. + +`--all` + +: Start all services and register them to launch at login (or boot). + \[`sudo`\] `brew services run` (*`formula`*\|`--all`) \[`--file=`\] : Run the service *`formula`* without registering to launch at login (or boot). -\[`sudo`\] `brew services restart` (*`formula`*\|`--all`) \[`--file=`\] +`--file` -: Stop (if necessary) and start the service *`formula`* immediately and register - it to launch at login (or boot). +: Use the service file from this location to `run` the service. -\[`sudo`\] `brew services` \[`list`\] \[`--json`\] \[`--debug`\] +`--all` -: List information about all managed services for the current user (or root). - Provides more output from Homebrew and `launchctl`(1) or `systemctl`(1) if run - with `--debug`. +: Run all services without registering them to launch at login (or boot). -\[`sudo`\] `brew services kill` (*`formula`*\|`--all`) +\[`sudo`\] `brew services restart` (*`formula`*\|`--all`) \[`--file=`\] -: Stop the service *`formula`* immediately but keep it registered to launch at - login (or boot). +: Stop (if necessary) and start the service *`formula`* immediately and register + it to launch at login (or boot). -\[`sudo`\] `brew services info` (*`formula`*\|`--all`) \[`--json`\] +`--file` -: List all managed services for the current user (or root). +: Use the service file from this location to `start` the service. -\[`sudo`\] `brew services cleanup` +`--all` -: Remove all unused services. +: Restart all services. -`--sudo-service-user` +\[`sudo`\] `brew services` \[`list`\] \[`--json`\] \[`--debug`\] -: When run as root on macOS, run the service(s) as this user. +: List information about all managed services for the current user (or root). + Provides more output from Homebrew and `launchctl`(1) or `systemctl`(1) if run + with `--debug`. -`--max-wait` +`--json` -: Wait at most this many seconds for `stop` to finish stopping a service. - Defaults to 60. Set this to zero (0) seconds to wait indefinitely. +: Output as JSON. -`--no-wait` +\[`sudo`\] `brew services kill` (*`formula`*\|`--all`) -: Don't wait for `stop` to finish stopping the service. +: Stop the service *`formula`* immediately but keep it registered to launch at + login (or boot). -`--keep` +`--all` -: When stopped, don't unregister the service from launching at login (or boot). +: Stop all services immediately but keep them registered to launch at login (or + boot). -`--file` +\[`sudo`\] `brew services info` (*`formula`*\|`--all`) \[`--json`\] -: Use the service file from this location to `start` the service. +: List all managed services for the current user (or root). `--all` -: Run *`subcommand`* on all services. +: List all managed services. `--json` : Output as JSON. +\[`sudo`\] `brew services cleanup` + +: Remove all unused services. + ### `setup-ruby` \[*`command`* ...\] Installs and configures Homebrew's Ruby. If `command` is passed, it will only @@ -4623,6 +4922,10 @@ command execution (e.g. `$(cat file)`). : If set, `brew info` and `brew install` will not warn when a formula's executables are shadowed by other commands earlier on `$PATH`. +`HOMEBREW_NO_SANDBOX_LINUX` + +: If set, disable the Linux sandbox. + `HOMEBREW_NO_UPDATE_REPORT_NEW` : If set, `brew update` will not show the list of newly added formulae/casks. diff --git a/manpages/brew.1 b/manpages/brew.1 index fc142c81d14f7..5adc5791a4670 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -93,20 +93,122 @@ Bundler for non\-Ruby dependencies from Homebrew, Homebrew Cask, Mac App Store d .P Note: Flatpak support is only available on Linux\. .TP +\fB\-\-file\fP +Read from or write to the \fBBrewfile\fP from this location\. Use \fB\-\-file=\-\fP to pipe to stdin/stdout\. +.TP +\fB\-g\fP, \fB\-\-global\fP +Read from or write to the \fBBrewfile\fP from \fB$HOMEBREW_BUNDLE_FILE_GLOBAL\fP (if set), \fB${XDG_CONFIG_HOME}/homebrew/Brewfile\fP (if \fB$XDG_CONFIG_HOME\fP is set), \fB~/\.homebrew/Brewfile\fP or \fB~/\.Brewfile\fP otherwise\. +.TP \fBbrew bundle upgrade\fP Shorthand for \fBbrew bundle install \-\-upgrade\fP\&\. .TP +\fB\-\-upgrade\fP +Run \fBbrew upgrade\fP on outdated dependencies, even if \fB$HOMEBREW_BUNDLE_NO_UPGRADE\fP is set\. +.TP +\fB\-\-upgrade\-formulae\fP +Run \fBbrew upgrade\fP on any of these comma\-separated formulae, even if \fB$HOMEBREW_BUNDLE_NO_UPGRADE\fP is set\. +.TP +\fB\-\-jobs\fP +Run up to this many formula installations in parallel\. Defaults to 1 (sequential)\. Use \fBauto\fP for the number of CPU cores (max 4)\. +.TP \fBbrew bundle sh\fP [\fB\-\-check\fP] [\fB\-\-no\-secrets\fP] Run your shell in a \fBbrew bundle exec\fP environment\. .TP +\fB\-\-install\fP +Run \fBinstall\fP before starting the shell\. +.TP +\fB\-\-services\fP +Temporarily start services while running the shell\. Enabled by default if \fB$HOMEBREW_BUNDLE_SERVICES\fP is set\. +.TP +\fB\-\-check\fP +Check that all dependencies in the Brewfile are installed before starting the shell\. Enabled by default if \fB$HOMEBREW_BUNDLE_CHECK\fP is set\. +.TP +\fB\-\-no\-secrets\fP +Attempt to remove secrets from the environment before starting the shell\. Enabled by default if \fB$HOMEBREW_BUNDLE_NO_SECRETS\fP is set\. +.TP \fBbrew bundle remove\fP \fIname\fP [\.\.\.] Remove entries that match \fBname\fP from your \fBBrewfile\fP\&\. Use \fB\-\-formula\fP, \fB\-\-cask\fP, \fB\-\-tap\fP, \fB\-\-mas\fP, \fB\-\-vscode\fP, \fB\-\-go\fP, \fB\-\-cargo\fP, \fB\-\-uv\fP, \fB\-\-flatpak\fP, \fB\-\-krew\fP and \fB\-\-npm\fP to remove only entries of the corresponding type\. Passing \fB\-\-formula\fP also removes matches against formula aliases and old formula names\. .TP +\fB\-\-install\fP +Run \fBinstall\fP before removing entries\. +.TP +\fB\-\-formula\fP +Remove Homebrew formula entries, including matches against formula aliases and old names\. +.TP +\fB\-\-cask\fP +Remove Homebrew cask entries\. +.TP +\fB\-\-tap\fP +Remove Homebrew tap entries\. +.TP +\fB\-\-mas\fP +Remove entries for Mac App Store dependencies\. +.TP +\fB\-\-vscode\fP +Remove entries for VSCode (and forks/variants) extensions\. +.TP +\fB\-\-go\fP +Remove entries for Go packages\. +.TP +\fB\-\-cargo\fP +Remove entries for Cargo packages\. +.TP +\fB\-\-uv\fP +Remove entries for uv tools\. +.TP +\fB\-\-flatpak\fP +Remove entries for Flatpak packages\. Note: Linux only\. +.TP +\fB\-\-krew\fP +Remove entries for Krew plugins\. +.TP +\fB\-\-npm\fP +Remove entries for npm packages\. +.TP \fBbrew bundle list\fP List all dependencies present in the \fBBrewfile\fP\&\. .P By default, only Homebrew formula dependencies are listed\. .TP +\fB\-\-install\fP +Run \fBinstall\fP before listing dependencies\. +.TP +\fB\-\-all\fP +List all dependencies\. +.TP +\fB\-\-formula\fP +List Homebrew formula dependencies\. +.TP +\fB\-\-cask\fP +List Homebrew cask dependencies\. +.TP +\fB\-\-tap\fP +List Homebrew tap dependencies\. +.TP +\fB\-\-mas\fP +List Mac App Store dependencies\. +.TP +\fB\-\-vscode\fP +List VSCode (and forks/variants) extensions\. +.TP +\fB\-\-go\fP +List Go packages\. +.TP +\fB\-\-cargo\fP +List Cargo packages\. +.TP +\fB\-\-uv\fP +List uv tools\. +.TP +\fB\-\-flatpak\fP +List Flatpak packages\. Note: Linux only\. +.TP +\fB\-\-krew\fP +List Krew plugins\. +.TP +\fB\-\-npm\fP +List npm packages\. +.TP \fBbrew bundle\fP [\fBinstall\fP] Install and upgrade (by default) all dependencies from the \fBBrewfile\fP\&\. .P @@ -116,67 +218,106 @@ You can specify the \fBBrewfile\fP location using \fB\-\-file\fP or by setting t .P You can skip the installation of dependencies by adding space\-separated values to one or more of the following environment variables: \fB$HOMEBREW_BUNDLE_BREW_SKIP\fP, \fB$HOMEBREW_BUNDLE_CASK_SKIP\fP, \fB$HOMEBREW_BUNDLE_MAS_SKIP\fP, \fB$HOMEBREW_BUNDLE_TAP_SKIP\fP\&\. .TP +\fB\-v\fP, \fB\-\-verbose\fP +Print output from commands as they are run\. +.TP +\fB\-\-no\-upgrade\fP +Do not run \fBbrew upgrade\fP on outdated dependencies\. Note they may still be upgraded by \fBbrew install\fP if needed\. Enabled by default if \fB$HOMEBREW_BUNDLE_NO_UPGRADE\fP is set\. +.TP +\fB\-\-upgrade\fP +Run \fBbrew upgrade\fP on outdated dependencies, even if \fB$HOMEBREW_BUNDLE_NO_UPGRADE\fP is set\. +.TP +\fB\-\-upgrade\-formulae\fP +Run \fBbrew upgrade\fP on any of these comma\-separated formulae, even if \fB$HOMEBREW_BUNDLE_NO_UPGRADE\fP is set\. +.TP +\fB\-\-jobs\fP +Run up to this many formula installations in parallel\. Defaults to 1 (sequential)\. Use \fBauto\fP for the number of CPU cores (max 4)\. +.TP +\fB\-f\fP, \fB\-\-force\fP +Run with \fB\-\-force\fP/\fB\-\-overwrite\fP\&\. +.TP +\fB\-\-cleanup\fP +Perform cleanup after installing dependencies, same as running \fBcleanup \-\-force\fP\&\. Enabled by default if \fB$HOMEBREW_BUNDLE_INSTALL_CLEANUP\fP is set and \fB\-\-global\fP is passed\. +.TP +\fB\-\-zap\fP +Use \fBzap\fP instead of \fBuninstall\fP when cleaning up casks after installing dependencies\. +.TP \fBbrew bundle exec\fP [\fB\-\-check\fP] [\fB\-\-no\-secrets\fP] \fIcommand\fP Run an external command in an isolated build environment based on the \fBBrewfile\fP dependencies\. .P This sanitized build environment ignores unrequested dependencies, which makes sure that things you didn\[u2019]t specify in your \fBBrewfile\fP won\[u2019]t get picked up by commands like \fBbundle install\fP, \fBnpm install\fP, etc\. It will also add compiler flags which will help with finding keg\-only dependencies like \fBopenssl\fP, \fBicu4c\fP, etc\. .TP +\fB\-\-install\fP +Run \fBinstall\fP before executing the command\. +.TP +\fB\-\-services\fP +Temporarily start services while executing the command\. Enabled by default if \fB$HOMEBREW_BUNDLE_SERVICES\fP is set\. +.TP +\fB\-\-check\fP +Check that all dependencies in the Brewfile are installed before executing the command\. Enabled by default if \fB$HOMEBREW_BUNDLE_CHECK\fP is set\. +.TP +\fB\-\-no\-secrets\fP +Attempt to remove secrets from the environment before executing the command\. Enabled by default if \fB$HOMEBREW_BUNDLE_NO_SECRETS\fP is set\. +.TP \fBbrew bundle env\fP [\fB\-\-check\fP] [\fB\-\-no\-secrets\fP] Print the environment variables that would be set in a \fBbrew bundle exec\fP environment\. .TP +\fB\-\-install\fP +Run \fBinstall\fP before printing the environment\. +.TP +\fB\-\-check\fP +Check that all dependencies in the Brewfile are installed before printing the environment\. Enabled by default if \fB$HOMEBREW_BUNDLE_CHECK\fP is set\. +.TP +\fB\-\-no\-secrets\fP +Attempt to remove secrets from the environment before printing it\. Enabled by default if \fB$HOMEBREW_BUNDLE_NO_SECRETS\fP is set\. +.TP \fBbrew bundle edit\fP Edit the \fBBrewfile\fP in your editor\. .TP +\fB\-\-install\fP +Run \fBinstall\fP before editing the \fBBrewfile\fP\&\. +.TP \fBbrew bundle dump\fP Write all installed casks/formulae/images/taps into a \fBBrewfile\fP in the current directory or to a custom file specified with the \fB\-\-file\fP option\. This is useful as an installed\-state snapshot and can be kept in version control and diffed\. .TP -\fBbrew bundle cleanup\fP -Uninstall all dependencies not present in the \fBBrewfile\fP\&\. -.P -This workflow is useful for maintainers or testers who regularly install lots of formulae\. -.P -Unless \fB\-\-force\fP is passed, this returns a 1 exit code if anything would be removed\. -.TP -\fBbrew bundle check\fP -Check if all dependencies present in the \fBBrewfile\fP are installed\. -.P -This provides a successful exit code if everything is up\-to\-date, making it useful for scripting\. Use \fB\-\-verbose\fP to list unmet dependencies\. +\fB\-\-install\fP +Run \fBinstall\fP before dumping dependencies\. .TP -\fBbrew bundle add\fP \fIname\fP [\.\.\.] -Add entries to your \fBBrewfile\fP\&\. Adds formulae by default\. Use \fB\-\-cask\fP, \fB\-\-tap\fP, \fB\-\-vscode\fP, \fB\-\-go\fP, \fB\-\-cargo\fP, \fB\-\-uv\fP, \fB\-\-flatpak\fP, \fB\-\-krew\fP and \fB\-\-npm\fP to add the corresponding entry instead\. +\fB\-f\fP, \fB\-\-force\fP +Overwrite an existing \fBBrewfile\fP\&\. .TP -\fB\-\-file\fP -Read from or write to the \fBBrewfile\fP from this location\. Use \fB\-\-file=\-\fP to pipe to stdin/stdout\. +\fB\-\-formula\fP +Dump Homebrew formula dependencies\. .TP -\fB\-g\fP, \fB\-\-global\fP -Read from or write to the \fBBrewfile\fP from \fB$HOMEBREW_BUNDLE_FILE_GLOBAL\fP (if set), \fB${XDG_CONFIG_HOME}/homebrew/Brewfile\fP (if \fB$XDG_CONFIG_HOME\fP is set), \fB~/\.homebrew/Brewfile\fP or \fB~/\.Brewfile\fP otherwise\. +\fB\-\-cask\fP +Dump Homebrew cask dependencies\. .TP -\fB\-\-all\fP -\fBlist\fP all dependencies\. +\fB\-\-tap\fP +Dump Homebrew tap dependencies\. .TP -\fB\-\-upgrade\fP -\fBinstall\fP runs \fBbrew upgrade\fP on outdated dependencies, even if \fB$HOMEBREW_BUNDLE_NO_UPGRADE\fP is set\. +\fB\-\-mas\fP +Dump Mac App Store dependencies\. .TP -\fB\-\-upgrade\-formulae\fP -\fBinstall\fP runs \fBbrew upgrade\fP on any of these comma\-separated formulae, even if \fB$HOMEBREW_BUNDLE_NO_UPGRADE\fP is set\. +\fB\-\-vscode\fP +Dump VSCode (and forks/variants) extensions\. .TP -\fB\-\-jobs\fP -\fBinstall\fP runs up to this many formula installations in parallel\. Defaults to 1 (sequential)\. Use \fBauto\fP for the number of CPU cores (max 4)\. +\fB\-\-go\fP +Dump Go packages\. .TP -\fB\-\-cleanup\fP -\fBinstall\fP performs cleanup operation, same as running \fBcleanup \-\-force\fP\&\. Enabled by default if \fB$HOMEBREW_BUNDLE_INSTALL_CLEANUP\fP is set and \fB\-\-global\fP is passed\. +\fB\-\-cargo\fP +Dump Cargo packages\. .TP -\fB\-\-services\fP -Temporarily start services while running the \fBexec\fP or \fBsh\fP command\. Enabled by default if \fB$HOMEBREW_BUNDLE_SERVICES\fP is set\. +\fB\-\-uv\fP +Dump uv tools\. .TP -\fB\-\-check\fP -Check that all dependencies in the Brewfile are installed before running \fBexec\fP, \fBsh\fP, or \fBenv\fP\&\. Enabled by default if \fB$HOMEBREW_BUNDLE_CHECK\fP is set\. +\fB\-\-flatpak\fP +Dump Flatpak packages\. Note: Linux only\. .TP -\fB\-\-no\-secrets\fP -Attempt to remove secrets from the environment before \fBexec\fP, \fBsh\fP, or \fBenv\fP\&\. Enabled by default if \fB$HOMEBREW_BUNDLE_NO_SECRETS\fP is set\. +\fB\-\-krew\fP +Dump Krew plugins\. .TP -\fB\-\-mas\fP -\fBlist\fP or \fBdump\fP Mac App Store dependencies\. +\fB\-\-npm\fP +Dump npm packages\. .TP \fB\-\-no\-vscode\fP \fBdump\fP without VSCode (and forks/variants) extensions\. Enabled by default if \fB$HOMEBREW_BUNDLE_DUMP_NO_VSCODE\fP is set\. @@ -199,23 +340,74 @@ Attempt to remove secrets from the environment before \fBexec\fP, \fBsh\fP, or \ \fB\-\-no\-npm\fP \fBdump\fP without npm packages\. Enabled by default if \fB$HOMEBREW_BUNDLE_DUMP_NO_NPM\fP is set\. .TP +\fB\-\-describe\fP +Add a description comment above each line, unless the dependency does not have a description\. Enabled by default if \fB$HOMEBREW_BUNDLE_DESCRIBE\fP is set\. +.TP \fB\-\-no\-restart\fP -\fBdump\fP does not add \fBrestart_service\fP to formula lines\. +Do not add \fBrestart_service\fP to formula lines\. +.TP +\fBbrew bundle cleanup\fP +Uninstall all dependencies not present in the \fBBrewfile\fP\&\. +.P +This workflow is useful for maintainers or testers who regularly install lots of formulae\. +.P +Unless \fB\-\-force\fP is passed, this returns a 1 exit code if anything would be removed\. +.TP +\fB\-\-install\fP +Run \fBinstall\fP before cleaning up dependencies\. .TP \fB\-f\fP, \fB\-\-force\fP -\fBinstall\fP runs with \fB\-\-force\fP/\fB\-\-overwrite\fP\&\. \fBdump\fP overwrites an existing \fBBrewfile\fP\&\. \fBcleanup\fP actually performs its cleanup operations\. +Actually perform cleanup operations\. +.TP +\fB\-\-formula\fP +Clean up Homebrew formula dependencies\. +.TP +\fB\-\-cask\fP +Clean up Homebrew cask dependencies\. +.TP +\fB\-\-tap\fP +Clean up Homebrew tap dependencies\. +.TP +\fB\-\-vscode\fP +Clean up VSCode (and forks/variants) extensions\. +.TP +\fB\-\-go\fP +Clean up Go packages\. +.TP +\fB\-\-cargo\fP +Clean up Cargo packages\. +.TP +\fB\-\-uv\fP +Clean up uv tools\. +.TP +\fB\-\-flatpak\fP +Clean up Flatpak packages\. Note: Linux only\. +.TP +\fB\-\-npm\fP +Clean up npm packages\. .TP \fB\-\-zap\fP -\fBcleanup\fP casks using the \fBzap\fP command instead of \fBuninstall\fP\&\. +Clean up casks using the \fBzap\fP command instead of \fBuninstall\fP\&\. +.TP +\fBbrew bundle check\fP +Check if all dependencies present in the \fBBrewfile\fP are installed\. +.P +This provides a successful exit code if everything is up\-to\-date, making it useful for scripting\. Use \fB\-\-verbose\fP to list unmet dependencies\. .TP \fB\-v\fP, \fB\-\-verbose\fP -\fBinstall\fP prints output from commands as they are run\. \fBcheck\fP lists all missing dependencies\. +List all missing dependencies\. .TP \fB\-\-no\-upgrade\fP -\fBinstall\fP does not run \fBbrew upgrade\fP on outdated dependencies\. \fBcheck\fP does not check for outdated dependencies\. Note they may still be upgraded by \fBbrew install\fP if needed\. Enabled by default if \fB$HOMEBREW_BUNDLE_NO_UPGRADE\fP is set\. +Do not check for outdated dependencies\. Note they may still be upgraded by \fBbrew install\fP if needed\. Enabled by default if \fB$HOMEBREW_BUNDLE_NO_UPGRADE\fP is set\. .TP \fB\-\-install\fP -Run \fBinstall\fP before continuing to other operations, e\.g\. \fBexec\fP\&\. +Run \fBinstall\fP before checking dependencies\. +.TP +\fBbrew bundle add\fP \fIname\fP [\.\.\.] +Add entries to your \fBBrewfile\fP\&\. Adds formulae by default\. Use \fB\-\-cask\fP, \fB\-\-tap\fP, \fB\-\-vscode\fP, \fB\-\-go\fP, \fB\-\-cargo\fP, \fB\-\-uv\fP, \fB\-\-flatpak\fP, \fB\-\-krew\fP and \fB\-\-npm\fP to add the corresponding entry instead\. +.TP +\fB\-\-install\fP +Run \fBinstall\fP before adding entries\. .TP \fB\-\-formula\fP Add Homebrew formula entries\. @@ -227,28 +419,28 @@ Add Homebrew cask entries\. Add Homebrew tap entries\. .TP \fB\-\-vscode\fP -\fBlist\fP, \fBdump\fP or \fBcleanup\fP VSCode (and forks/variants) extensions\. +Add entries for VSCode (and forks/variants) extensions\. .TP \fB\-\-go\fP -\fBlist\fP, \fBdump\fP or \fBcleanup\fP Go packages\. +Add entries for Go packages\. .TP \fB\-\-cargo\fP -\fBlist\fP, \fBdump\fP or \fBcleanup\fP Cargo packages\. +Add entries for Cargo packages\. .TP \fB\-\-uv\fP -\fBlist\fP, \fBdump\fP or \fBcleanup\fP uv tools\. +Add entries for uv tools\. .TP \fB\-\-flatpak\fP -\fBlist\fP, \fBdump\fP or \fBcleanup\fP Flatpak packages\. Note: Linux only\. +Add entries for Flatpak packages\. Note: Linux only\. .TP \fB\-\-krew\fP -\fBlist\fP or \fBdump\fP Krew plugins\. +Add entries for Krew plugins\. .TP \fB\-\-npm\fP -\fBlist\fP, \fBdump\fP or \fBcleanup\fP npm packages\. +Add entries for npm packages\. .TP \fB\-\-describe\fP -\fBdump\fP and \fBadd\fP add a description comment above each line, unless the dependency does not have a description\. Enabled by default if \fB$HOMEBREW_BUNDLE_DESCRIBE\fP is set\. +Add a description comment above each line, unless the dependency does not have a description\. Enabled by default if \fB$HOMEBREW_BUNDLE_DESCRIBE\fP is set\. .SS "\fBcasks\fP" List all locally installable casks including short names\. .SS "\fBcleanup\fP \fR[\fIoptions\fP] \fR[\fIformula\fP|\fIcask\fP \.\.\.]" @@ -954,50 +1146,74 @@ Manage background services with macOS\[u2019] \fBlaunchctl\fP(1) daemon manager .P If \fBsudo\fP is passed, operate on \fB/Library/LaunchDaemons\fP or \fB/usr/lib/systemd/system\fP (started at boot)\. Otherwise, operate on \fB~/Library/LaunchAgents\fP or \fB~/\.config/systemd/user\fP (started at login)\. .TP +\fB\-\-sudo\-service\-user\fP +When run as root on macOS, run the service(s) as this user\. +.TP [\fBsudo\fP] \fBbrew services stop\fP [\fB\-\-keep\fP] [\fB\-\-no\-wait\fP|\fB\-\-max\-wait=\fP] (\fIformula\fP|\fB\-\-all\fP) Stop the service \fIformula\fP immediately and unregister it from launching at login (or boot), unless \fB\-\-keep\fP is specified\. .TP +\fB\-\-max\-wait\fP +Wait at most this many seconds for \fBstop\fP to finish stopping a service\. Defaults to 60\. Set this to zero (0) seconds to wait indefinitely\. +.TP +\fB\-\-no\-wait\fP +Don\[u2019]t wait for \fBstop\fP to finish stopping the service\. +.TP +\fB\-\-keep\fP +When stopped, don\[u2019]t unregister the service from launching at login (or boot)\. +.TP +\fB\-\-all\fP +Stop all services and unregister them from launching at login (or boot), unless \fB\-\-keep\fP is specified\. +.TP [\fBsudo\fP] \fBbrew services start\fP (\fIformula\fP|\fB\-\-all\fP) [\fB\-\-file=\fP] Start the service \fIformula\fP immediately and register it to launch at login (or boot)\. .TP +\fB\-\-file\fP +Use the service file from this location to \fBstart\fP the service\. +.TP +\fB\-\-all\fP +Start all services and register them to launch at login (or boot)\. +.TP [\fBsudo\fP] \fBbrew services run\fP (\fIformula\fP|\fB\-\-all\fP) [\fB\-\-file=\fP] Run the service \fIformula\fP without registering to launch at login (or boot)\. .TP +\fB\-\-file\fP +Use the service file from this location to \fBrun\fP the service\. +.TP +\fB\-\-all\fP +Run all services without registering them to launch at login (or boot)\. +.TP [\fBsudo\fP] \fBbrew services restart\fP (\fIformula\fP|\fB\-\-all\fP) [\fB\-\-file=\fP] Stop (if necessary) and start the service \fIformula\fP immediately and register it to launch at login (or boot)\. .TP +\fB\-\-file\fP +Use the service file from this location to \fBstart\fP the service\. +.TP +\fB\-\-all\fP +Restart all services\. +.TP [\fBsudo\fP] \fBbrew services\fP [\fBlist\fP] [\fB\-\-json\fP] [\fB\-\-debug\fP] List information about all managed services for the current user (or root)\. Provides more output from Homebrew and \fBlaunchctl\fP(1) or \fBsystemctl\fP(1) if run with \fB\-\-debug\fP\&\. .TP +\fB\-\-json\fP +Output as JSON\. +.TP [\fBsudo\fP] \fBbrew services kill\fP (\fIformula\fP|\fB\-\-all\fP) Stop the service \fIformula\fP immediately but keep it registered to launch at login (or boot)\. .TP +\fB\-\-all\fP +Stop all services immediately but keep them registered to launch at login (or boot)\. +.TP [\fBsudo\fP] \fBbrew services info\fP (\fIformula\fP|\fB\-\-all\fP) [\fB\-\-json\fP] List all managed services for the current user (or root)\. .TP -[\fBsudo\fP] \fBbrew services cleanup\fP -Remove all unused services\. -.TP -\fB\-\-sudo\-service\-user\fP -When run as root on macOS, run the service(s) as this user\. -.TP -\fB\-\-max\-wait\fP -Wait at most this many seconds for \fBstop\fP to finish stopping a service\. Defaults to 60\. Set this to zero (0) seconds to wait indefinitely\. -.TP -\fB\-\-no\-wait\fP -Don\[u2019]t wait for \fBstop\fP to finish stopping the service\. -.TP -\fB\-\-keep\fP -When stopped, don\[u2019]t unregister the service from launching at login (or boot)\. -.TP -\fB\-\-file\fP -Use the service file from this location to \fBstart\fP the service\. -.TP \fB\-\-all\fP -Run \fIsubcommand\fP on all services\. +List all managed services\. .TP \fB\-\-json\fP Output as JSON\. +.TP +[\fBsudo\fP] \fBbrew services cleanup\fP +Remove all unused services\. .SS "\fBsetup\-ruby\fP \fR[\fIcommand\fP \.\.\.]" Installs and configures Homebrew\[u2019]s Ruby\. If \fBcommand\fP is passed, it will only run Bundler if necessary for that command\. .SS "\fBshellenv\fP \fR[\fIshell\fP \.\.\.]" @@ -3000,6 +3216,9 @@ If set, \fBbrew install\fP \fIformula|cask\fP will not upgrade \fIformula|cask\f \fBHOMEBREW_NO_PATH_SHADOW_CHECK\fP If set, \fBbrew info\fP and \fBbrew install\fP will not warn when a formula\[u2019]s executables are shadowed by other commands earlier on \fB$PATH\fP\&\. .TP +\fBHOMEBREW_NO_SANDBOX_LINUX\fP +If set, disable the Linux sandbox\. +.TP \fBHOMEBREW_NO_UPDATE_REPORT_NEW\fP If set, \fBbrew update\fP will not show the list of newly added formulae/casks\. .TP