Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions Library/Homebrew/bundle/extensions/extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/bundle/extensions/flatpak.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/bundle/subcommand/add.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand Down
8 changes: 3 additions & 5 deletions Library/Homebrew/bundle/subcommand/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
16 changes: 7 additions & 9 deletions Library/Homebrew/bundle/subcommand/cleanup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
18 changes: 8 additions & 10 deletions Library/Homebrew/bundle/subcommand/dump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,30 @@ 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}",
description: extension.dump_disable_description,
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 }
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/bundle/subcommand/edit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/bundle/subcommand/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions Library/Homebrew/bundle/subcommand/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 9 additions & 12 deletions Library/Homebrew/bundle/subcommand/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions Library/Homebrew/bundle/subcommand/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/bundle/subcommand/remove.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions Library/Homebrew/bundle/subcommand/sh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/bundle/subcommand/upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading
Loading