Merge pull request #7393 from EricFromCanada/command-fixes

cmd/dev-cmd: various output fixes
This commit is contained in:
Mike McQuaid 2020-04-20 09:53:47 +01:00 committed by GitHub
commit dad4249774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 157 additions and 184 deletions

View File

@ -13,7 +13,7 @@ module Homebrew
Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if
that directory doesn't exist, `$(brew --repository)/Cellar`. that directory doesn't exist, `$(brew --repository)/Cellar`.
If <formula> is provided, display the location in the cellar where <formula> If <formula> is provided, display the location in the Cellar where <formula>
would be installed, without any sort of versioned directory as the last path. would be installed, without any sort of versioned directory as the last path.
EOS EOS
end end

View File

@ -13,7 +13,7 @@ module Homebrew
Display Homebrew's install path. *Default:* `/usr/local` on macOS and Display Homebrew's install path. *Default:* `/usr/local` on macOS and
`/home/linuxbrew/.linuxbrew` on Linux. `/home/linuxbrew/.linuxbrew` on Linux.
If <formula> is provided, display the location in the cellar where <formula> If <formula> is provided, display the location in the Cellar where <formula>
is or would be installed. is or would be installed.
EOS EOS
end end

View File

@ -10,12 +10,17 @@ module Homebrew
usage_banner <<~EOS usage_banner <<~EOS
`analytics` [<subcommand>] `analytics` [<subcommand>]
If `on` or `off` is passed, turn Homebrew's analytics on or off respectively. Control Homebrew's anonymous aggregate user behaviour analytics.
If `state` is passed, display the current anonymous user behaviour analytics state.
Read more at <https://docs.brew.sh/Analytics>. Read more at <https://docs.brew.sh/Analytics>.
If `regenerate-uuid` is passed, regenerate the UUID used in Homebrew's analytics. `brew analytics` [`state`]:
Display the current state of Homebrew's analytics.
`brew analytics` [`on`|`off`]:
Turn Homebrew's analytics on or off respectively.
`brew analytics regenerate-uuid`:
Regenerate the UUID used for Homebrew's analytics.
EOS EOS
switch :verbose switch :verbose
switch :debug switch :debug
@ -41,7 +46,7 @@ module Homebrew
when "regenerate-uuid" when "regenerate-uuid"
Utils::Analytics.regenerate_uuid! Utils::Analytics.regenerate_uuid!
else else
raise UsageError, "unknown subcommand" raise UsageError, "unknown subcommand: #{args.named.first}"
end end
end end
end end

View File

@ -29,7 +29,7 @@ module Homebrew
def log def log
log_args.parse log_args.parse
# As this command is simplifying user run commands then let's just use a # As this command is simplifying user-run commands then let's just use a
# user path, too. # user path, too.
ENV["PATH"] = ENV["HOMEBREW_PATH"] ENV["PATH"] = ENV["HOMEBREW_PATH"]

View File

@ -8,7 +8,7 @@ module Homebrew
def tap_args def tap_args
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do
usage_banner <<~EOS usage_banner <<~EOS
`tap` [<options>] <user>`/`<repo> [<URL>] `tap` [<options>] [<user>`/`<repo>] [<URL>]
Tap a formula repository. Tap a formula repository.
@ -36,8 +36,7 @@ module Homebrew
description: "Migrate tapped formulae from symlink-based to directory-based structure." description: "Migrate tapped formulae from symlink-based to directory-based structure."
switch "--list-pinned", switch "--list-pinned",
description: "List all pinned taps." description: "List all pinned taps."
switch :quiet, switch :quiet
description: "Suppress any warnings."
switch :debug switch :debug
max_named 2 max_named 2
end end

View File

@ -16,14 +16,13 @@ module Homebrew
EOS EOS
switch :verbose switch :verbose
switch :debug switch :debug
min_named :formula
end end
end end
def unpin def unpin
unpin_args.parse unpin_args.parse
raise FormulaUnspecifiedError if args.no_named?
args.resolved_formulae.each do |f| args.resolved_formulae.each do |f|
if f.pinned? if f.pinned?
f.unpin f.unpin

View File

@ -109,7 +109,7 @@ module Homebrew
def bump_formula_pr def bump_formula_pr
bump_formula_pr_args.parse bump_formula_pr_args.parse
# As this command is simplifying user run commands then let's just use a # As this command is simplifying user-run commands then let's just use a
# user path, too. # user path, too.
ENV["PATH"] = ENV["HOMEBREW_PATH"] ENV["PATH"] = ENV["HOMEBREW_PATH"]

View File

@ -22,21 +22,18 @@ module Homebrew
switch :quiet switch :quiet
switch :verbose switch :verbose
switch :debug switch :debug
max_named 1 named :formula
end end
end end
def bump_revision def bump_revision
bump_revision_args.parse bump_revision_args.parse
# As this command is simplifying user run commands then let's just use a # As this command is simplifying user-run commands then let's just use a
# user path, too. # user path, too.
ENV["PATH"] = ENV["HOMEBREW_PATH"] ENV["PATH"] = ENV["HOMEBREW_PATH"]
formulae = args.formulae formula = args.formulae.first
raise FormulaUnspecifiedError if formulae.empty?
formula = formulae.first
current_revision = formula.revision current_revision = formula.revision
if current_revision.zero? if current_revision.zero?

View File

@ -10,7 +10,7 @@ module Homebrew
usage_banner <<~EOS usage_banner <<~EOS
`mirror` <formula> `mirror` <formula>
Reuploads the stable URL for a formula to Bintray to use it as a mirror. Reupload the stable URL of a formula to Bintray for use as a mirror.
EOS EOS
switch :verbose switch :verbose
switch :debug switch :debug

View File

@ -11,20 +11,21 @@ module Homebrew
usage_banner <<~EOS usage_banner <<~EOS
`pr-automerge` [<options>] `pr-automerge` [<options>]
Finds pull requests that can be automatically merged using `brew pr-publish`. Find pull requests that can be automatically merged using `brew pr-publish`.
EOS EOS
flag "--tap=", flag "--tap=",
description: "Target repository tap (default: `homebrew/core`)" description: "Target tap repository (default: `homebrew/core`)."
flag "--with-label=", flag "--with-label=",
description: "Pull requests must have this label (default: `ready to merge`)" description: "Pull requests must have this label (default: `ready to merge`)."
comma_array "--without-labels=", comma_array "--without-labels=",
description: "Pull requests must not have these labels (default: `do not merge`, `new formula`)" description: "Pull requests must not have these labels (default: `do not merge`, `new formula`)."
switch "--publish", switch "--publish",
description: "Run `brew pr-publish` on matching pull requests." description: "Run `brew pr-publish` on matching pull requests."
switch "--ignore-failures", switch "--ignore-failures",
description: "Include pull requests that have failing status checks." description: "Include pull requests that have failing status checks."
switch :debug
switch :verbose switch :verbose
switch :debug
max_named 0
end end
end end
@ -57,8 +58,7 @@ module Homebrew
if args.publish? if args.publish?
safe_system "#{HOMEBREW_PREFIX}/bin/brew", "pr-publish", *pr_urls safe_system "#{HOMEBREW_PREFIX}/bin/brew", "pr-publish", *pr_urls
else else
ohai "Now run:" ohai "Now run:", " brew pr-publish \\\n #{pr_urls.join " \\\n "}"
puts " brew pr-publish \\\n #{pr_urls.join " \\\n "}"
end end
end end
end end

View File

@ -11,10 +11,11 @@ module Homebrew
usage_banner <<~EOS usage_banner <<~EOS
`pr-publish` [<options>] <pull_request> [<pull_request> ...] `pr-publish` [<options>] <pull_request> [<pull_request> ...]
Publishes bottles for a pull request with GitHub Actions. Publish bottles for a pull request with GitHub Actions.
Requires write access to the repository. Requires write access to the `homebrew/core` repository.
EOS EOS
switch :verbose switch :verbose
min_named 1
end end
end end
@ -23,8 +24,6 @@ module Homebrew
ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"] = "1" unless OS.mac? ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"] = "1" unless OS.mac?
odie "You need to specify at least one pull request number!" if Homebrew.args.named.empty?
args.named.uniq.each do |arg| args.named.uniq.each do |arg|
arg = "#{CoreTap.instance.default_remote}/pull/#{arg}" if arg.to_i.positive? arg = "#{CoreTap.instance.default_remote}/pull/#{arg}" if arg.to_i.positive?
url_match = arg.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX url_match = arg.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX

View File

@ -15,32 +15,32 @@ module Homebrew
`pr-pull` [<options>] <pull_request> [<pull_request> ...] `pr-pull` [<options>] <pull_request> [<pull_request> ...]
Download and publish bottles, and apply the bottle commit from a Download and publish bottles, and apply the bottle commit from a
pull request with artifacts generated from GitHub Actions. pull request with artifacts generated by GitHub Actions.
Requires write access to the repository. Requires write access to the repository.
EOS EOS
switch "--no-publish", switch "--no-publish",
description: "Download the bottles, apply the bottle commit, and "\ description: "Download the bottles, apply the bottle commit and "\
"upload the bottles to Bintray, but don't publish them." "upload the bottles to Bintray, but don't publish them."
switch "--no-upload", switch "--no-upload",
description: "Download the bottles and apply the bottle commit, "\ description: "Download the bottles and apply the bottle commit, "\
"but don't upload to Bintray." "but don't upload to Bintray."
switch "--dry-run", "-n", switch "-n", "--dry-run",
description: "Print what would be done rather than doing it." description: "Print what would be done rather than doing it."
switch "--clean", switch "--clean",
description: "Do not amend the commits from pull requests." description: "Do not amend the commits from pull requests."
switch "--branch-okay", switch "--branch-okay",
description: "Do not warn if pulling to a branch besides master (useful for testing)." description: "Do not warn if pulling to a branch besides master (useful for testing)."
switch "--resolve", switch "--resolve",
description: "When a patch fails to apply, leave in progress and allow user to resolve, instead "\ description: "When a patch fails to apply, leave in progress and allow user to resolve, "\
"of aborting." "instead of aborting."
flag "--workflow=", flag "--workflow=",
description: "Retrieve artifacts from the specified workflow (default: tests.yml)." description: "Retrieve artifacts from the specified workflow (default: tests.yml)."
flag "--artifact=", flag "--artifact=",
description: "Download artifacts with the specified name (default: bottles)." description: "Download artifacts with the specified name (default: bottles)."
flag "--bintray-org=", flag "--bintray-org=",
description: "Upload to the specified Bintray organisation (default: homebrew)." description: "Upload to the specified Bintray organisation (default: homebrew)."
flag "--tap=", flag "--tap=",
description: "Target repository tap (default: homebrew/core)." description: "Target tap repository (default: homebrew/core)."
switch :verbose switch :verbose
switch :debug switch :debug
min_named 1 min_named 1

View File

@ -12,6 +12,7 @@ module Homebrew
Run Homebrew with the Ruby profiler, e.g. `brew prof readall`. Run Homebrew with the Ruby profiler, e.g. `brew prof readall`.
EOS EOS
min_named 1
end end
end end

View File

@ -22,8 +22,8 @@ module Homebrew
Get a patch from a GitHub commit or pull request and apply it to Homebrew. Get a patch from a GitHub commit or pull request and apply it to Homebrew.
Optionally, publish updated bottles for any formulae changed by the patch. Optionally, publish updated bottles for any formulae changed by the patch.
Each <patch> may be the number of a pull request in `homebrew/core`, the URL of any pull request Each <patch> may be the number of a pull request in `homebrew/core`
or commit on GitHub. or the URL of any pull request or commit on GitHub.
EOS EOS
switch "--bump", switch "--bump",
description: "For one-formula PRs, automatically reword commit message to our preferred format." description: "For one-formula PRs, automatically reword commit message to our preferred format."

View File

@ -26,6 +26,7 @@ module Homebrew
switch :verbose switch :verbose
switch :debug switch :debug
conflicts "--git", "--patch" conflicts "--git", "--patch"
min_named :formula
end end
end end
@ -33,7 +34,6 @@ module Homebrew
unpack_args.parse unpack_args.parse
formulae = args.formulae formulae = args.formulae
raise FormulaUnspecifiedError if formulae.empty?
if dir = args.destdir if dir = args.destdir
unpack_dir = Pathname.new(dir).expand_path unpack_dir = Pathname.new(dir).expand_path

View File

@ -65,7 +65,7 @@ If no search term is provided, all locally available formulae are listed.
## OFFICIAL EXTERNAL COMMANDS ## OFFICIAL EXTERNAL COMMANDS
### `cask` <subcommand>: ### `cask` <subcommand>
Install macOS applications distributed as binaries. See `brew-cask`(1). Install macOS applications distributed as binaries. See `brew-cask`(1).

View File

@ -167,33 +167,6 @@ describe Cask::Cmd::Upgrade, :cask do
expect(local_transmission.versions).to include("2.60") expect(local_transmission.versions).to include("2.60")
expect(local_transmission.versions).not_to include("2.61") expect(local_transmission.versions).not_to include("2.61")
end end
it 'would update "auto_updates" and "latest" Casks when their tokens are provided in the command line' do
local_caffeine = Cask::CaskLoader.load("local-caffeine")
local_caffeine_path = Cask::Config.global.appdir.join("Caffeine.app")
auto_updates = Cask::CaskLoader.load("auto-updates")
auto_updates_path = Cask::Config.global.appdir.join("MyFancyApp.app")
expect(local_caffeine).to be_installed
expect(local_caffeine_path).to be_a_directory
expect(local_caffeine.versions).to include("1.2.2")
expect(auto_updates).to be_installed
expect(auto_updates_path).to be_a_directory
expect(auto_updates.versions).to include("2.57")
described_class.run("--dry-run", "local-caffeine", "auto-updates")
expect(local_caffeine).to be_installed
expect(local_caffeine_path).to be_a_directory
expect(local_caffeine.versions).to include("1.2.2")
expect(local_caffeine.versions).not_to include("1.2.3")
expect(auto_updates).to be_installed
expect(auto_updates_path).to be_a_directory
expect(auto_updates.versions).to include("2.57")
expect(auto_updates.versions).not_to include("2.61")
end
end end
describe "with --greedy it checks additional Casks" do describe "with --greedy it checks additional Casks" do

View File

@ -36,15 +36,17 @@ module Formatter
# Wraps text to fit within a given number of columns using regular expressions that: # Wraps text to fit within a given number of columns using regular expressions that:
# #
# 1. convert hard-wrapped paragraphs to a single line # 1. convert hard-wrapped paragraphs to a single line
# 2. find any option descriptions longer than a pre-set length and wrap between words # 2. add line break and indent to subcommand descriptions
# 3. find any option descriptions longer than a pre-set length and wrap between words
# with a hanging indent, without breaking any words that overflow # with a hanging indent, without breaking any words that overflow
# 3. wrap any remaining description lines that need wrapping with the same indent # 4. wrap any remaining description lines that need wrapping with the same indent
# 4. wrap all lines to the given width. # 5. wrap all lines to the given width.
# @see https://macromates.com/blog/2006/wrapping-text-with-regular-expressions/ # @see https://macromates.com/blog/2006/wrapping-text-with-regular-expressions/
def wrap(s, width = 172) def wrap(s, width = 172)
desc = OPTION_DESC_WIDTH desc = OPTION_DESC_WIDTH
indent = width - desc indent = width - desc
s.gsub(/(?<=\S) *\n(?=\S)/, " ") s.gsub(/(?<=\S) *\n(?=\S)/, " ")
.gsub(/([`>)\]]:) /, "\\1\n ")
.gsub(/^( +-.+ +(?=\S.{#{desc}}))(.{1,#{desc}})( +|$)\n?/, "\\1\\2\n" + " " * indent) .gsub(/^( +-.+ +(?=\S.{#{desc}}))(.{1,#{desc}})( +|$)\n?/, "\\1\\2\n" + " " * indent)
.gsub(/^( {#{indent}}(?=\S.{#{desc}}))(.{1,#{desc}})( +|$)\n?/, "\\1\\2\n" + " " * indent) .gsub(/^( {#{indent}}(?=\S.{#{desc}}))(.{1,#{desc}})( +|$)\n?/, "\\1\\2\n" + " " * indent)
.gsub(/(.{1,#{width}})( +|$)\n?/, "\\1\n") .gsub(/(.{1,#{width}})( +|$)\n?/, "\\1\n")

View File

@ -44,13 +44,17 @@ If no search term is provided, all locally available formulae are listed.
### `analytics` [*`subcommand`*] ### `analytics` [*`subcommand`*]
If `on` or `off` is passed, turn Homebrew's analytics on or off respectively. Control Homebrew's anonymous aggregate user behaviour analytics. Read more at
<https://docs.brew.sh/Analytics>.
If `state` is passed, display the current anonymous user behaviour analytics `brew analytics` [`state`]:
state. Read more at <https://docs.brew.sh/Analytics>. Display the current state of Homebrew's analytics.
If `regenerate-uuid` is passed, regenerate the UUID used in Homebrew's `brew analytics` [`on`|`off`]:
analytics. Turn Homebrew's analytics on or off respectively.
`brew analytics regenerate-uuid`:
Regenerate the UUID used for Homebrew's analytics.
### `cleanup` [*`options`*] [*`formula`*|*`cask`*] ### `cleanup` [*`options`*] [*`formula`*|*`cask`*]
@ -437,7 +441,7 @@ Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.p
Symlink all of the specified *`version`* of *`formula`*'s installation into Symlink all of the specified *`version`* of *`formula`*'s installation into
Homebrew's prefix. Homebrew's prefix.
### `tap` [*`options`*] *`user`*`/`*`repo`* [*`URL`*] ### `tap` [*`options`*] [*`user`*`/`*`repo`*] [*`URL`*]
Tap a formula repository. Tap a formula repository.
@ -588,7 +592,7 @@ If *`formula`* is provided, display the file or directory used to cache *`formul
Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if that Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if that
directory doesn't exist, `$(brew --repository)/Cellar`. directory doesn't exist, `$(brew --repository)/Cellar`.
If *`formula`* is provided, display the location in the cellar where *`formula`* If *`formula`* is provided, display the location in the Cellar where *`formula`*
would be installed, without any sort of versioned directory as the last path. would be installed, without any sort of versioned directory as the last path.
### `--env` [*`options`*] [*`formula`*] ### `--env` [*`options`*] [*`formula`*]
@ -608,7 +612,7 @@ list is formatted for export to `bash`(1) unless `--plain` is passed.
Display Homebrew's install path. *Default:* `/usr/local` on macOS and Display Homebrew's install path. *Default:* `/usr/local` on macOS and
`/home/linuxbrew/.linuxbrew` on Linux. `/home/linuxbrew/.linuxbrew` on Linux.
If *`formula`* is provided, display the location in the cellar where *`formula`* is If *`formula`* is provided, display the location in the Cellar where *`formula`* is
or would be installed. or would be installed.
### `--repository`, `--repo` [*`user`*`/`*`repo`*] ### `--repository`, `--repo` [*`user`*`/`*`repo`*]
@ -848,14 +852,14 @@ Generate Homebrew's manpages.
### `pr-automerge` [*`options`*] ### `pr-automerge` [*`options`*]
Finds pull requests that can be automatically merged using `brew pr-publish`. Find pull requests that can be automatically merged using `brew pr-publish`.
* `--tap`: * `--tap`:
Target repository tap (default: `homebrew/core`) Target tap repository (default: `homebrew/core`).
* `--with-label`: * `--with-label`:
Pull requests must have this label (default: `ready to merge`) Pull requests must have this label (default: `ready to merge`).
* `--without-labels`: * `--without-labels`:
Pull requests must not have these labels (default: `do not merge`, `new formula`) Pull requests must not have these labels (default: `do not merge`, `new formula`).
* `--publish`: * `--publish`:
Run `brew pr-publish` on matching pull requests. Run `brew pr-publish` on matching pull requests.
* `--ignore-failures`: * `--ignore-failures`:
@ -863,17 +867,17 @@ Finds pull requests that can be automatically merged using `brew pr-publish`.
### `pr-publish` [*`options`*] *`pull_request`* [*`pull_request`* ...] ### `pr-publish` [*`options`*] *`pull_request`* [*`pull_request`* ...]
Publishes bottles for a pull request with GitHub Actions. Requires write access Publish bottles for a pull request with GitHub Actions. Requires write access to
to the repository. the `homebrew/core` repository.
### `pr-pull` [*`options`*] *`pull_request`* [*`pull_request`* ...] ### `pr-pull` [*`options`*] *`pull_request`* [*`pull_request`* ...]
Download and publish bottles, and apply the bottle commit from a pull request Download and publish bottles, and apply the bottle commit from a pull request
with artifacts generated from GitHub Actions. Requires write access to the with artifacts generated by GitHub Actions. Requires write access to the
repository. repository.
* `--no-publish`: * `--no-publish`:
Download the bottles, apply the bottle commit, and upload the bottles to Bintray, but don't publish them. Download the bottles, apply the bottle commit and upload the bottles to Bintray, but don't publish them.
* `--no-upload`: * `--no-upload`:
Download the bottles and apply the bottle commit, but don't upload to Bintray. Download the bottles and apply the bottle commit, but don't upload to Bintray.
* `-n`, `--dry-run`: * `-n`, `--dry-run`:
@ -891,7 +895,7 @@ repository.
* `--bintray-org`: * `--bintray-org`:
Upload to the specified Bintray organisation (default: homebrew). Upload to the specified Bintray organisation (default: homebrew).
* `--tap`: * `--tap`:
Target repository tap (default: homebrew/core). Target tap repository (default: homebrew/core).
### `prof` *`command`* ### `prof` *`command`*
@ -902,8 +906,8 @@ Run Homebrew with the Ruby profiler, e.g. `brew prof readall`.
Get a patch from a GitHub commit or pull request and apply it to Homebrew. Get a patch from a GitHub commit or pull request and apply it to Homebrew.
Optionally, publish updated bottles for any formulae changed by the patch. Optionally, publish updated bottles for any formulae changed by the patch.
Each *`patch`* may be the number of a pull request in `homebrew/core`, the URL of Each *`patch`* may be the number of a pull request in `homebrew/core` or the URL
any pull request or commit on GitHub. of any pull request or commit on GitHub.
* `--bump`: * `--bump`:
For one-formula PRs, automatically reword commit message to our preferred format. For one-formula PRs, automatically reword commit message to our preferred format.
@ -1049,52 +1053,46 @@ These options are applicable across multiple subcommands.
## OFFICIAL EXTERNAL COMMANDS ## OFFICIAL EXTERNAL COMMANDS
### `cask` *`subcommand`*: ### `cask` *`subcommand`*
Install macOS applications distributed as binaries. See `brew-cask`(1). Install macOS applications distributed as binaries. See `brew-cask`(1).
**Homebrew/homebrew-cask**: <https://github.com/Homebrew/homebrew-cask> **Homebrew/homebrew-cask**: <https://github.com/Homebrew/homebrew-cask>
### `bundle` *`subcommand`* ### `bundle` [*`subcommand`*]
Bundler for non-Ruby dependencies from Homebrew, Homebrew Cask, Mac App Store Bundler for non-Ruby dependencies from Homebrew, Homebrew Cask, Mac App Store
and Whalebrew. and Whalebrew.
`brew bundle` [`install`] `brew bundle` [`install`]:
Install or upgrade all dependencies in a `Brewfile`.
Install or upgrade all dependencies in a `Brewfile`. `brew bundle dump`:
Write all installed casks/formulae/images/taps into a `Brewfile`.
`brew bundle dump` `brew bundle cleanup`:
Uninstall all dependencies not listed in a `Brewfile`.
Write all installed casks/formulae/images/taps into a `Brewfile`. `brew bundle check`:
Check if all dependencies are installed in a `Brewfile`.
`brew bundle cleanup` `brew bundle exec` *`command`*:
Run an external command in an isolated build environment.
Uninstall all dependencies not listed in a `Brewfile`. `brew bundle list`:
List all dependencies present in a `Brewfile`. By default, only Homebrew
`brew bundle check`
Check if all dependencies are installed in a `Brewfile`.
`brew bundle exec` *`command`*
Run an external command in an isolated build environment.
`brew bundle list`
List all dependencies present in a Brewfile. By default, only Homebrew
dependencies are listed. dependencies are listed.
* `--file`: * `--file`:
Read the `Brewfile` from this file. Use `--file=-` to pipe to stdin/stdout. Read the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout.
* `--global`: * `--global`:
Read the `Brewfile` from `~/.Brewfile`. Read the `Brewfile` from `~/.Brewfile`.
* `-v`, `--verbose`: * `-v`, `--verbose`:
`install` output is printed from commands as they are run. `check` prints all missing dependencies. `install` prints output from commands as they are run. `check` lists all missing dependencies.
* `--no-upgrade`: * `--no-upgrade`:
`install` won't run `brew upgrade` on outdated dependencies. Note they may still be upgraded by `brew install` if needed. `install` won't run `brew upgrade` on outdated dependencies. Note they may still be upgraded by `brew install` if needed.
* `-f`, `--force`: * `-f`, `--force`:
`dump` overwrites an existing `Brewfile`. `cleanup` actually perform the cleanup operations. `dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations.
* `--no-lock`: * `--no-lock`:
`install` won't output a `Brewfile.lock.json`. `install` won't output a `Brewfile.lock.json`.
* `--all`: * `--all`:
@ -1110,39 +1108,39 @@ dependencies are listed.
* `--whalebrew`: * `--whalebrew`:
`list` Whalebrew dependencies. `list` Whalebrew dependencies.
* `--describe`: * `--describe`:
`dump` a description comment above each line, unless the dependency does not have a description. `dump` adds a description comment above each line, unless the dependency does not have a description.
* `--no-restart`: * `--no-restart`:
`dump` does not add `restart_service` to formula lines. `dump` does not add `restart_service` to formula lines.
* `--zap`: * `--zap`:
`cleanup` casks using the `zap` command instead of `uninstall`. `cleanup` casks using the `zap` command instead of `uninstall`.
### `services` *`subcommand`* ### `services` [*`subcommand`*]
Manage background services with macOS' `launchctl`(1) daemon manager. Manage background services with macOS' `launchctl`(1) daemon manager.
If `sudo` is passed, operate on `/Library/LaunchDaemons` (started at boot). If `sudo` is passed, operate on `/Library/LaunchDaemons` (started at boot).
Otherwise, operate on `~/Library/LaunchAgents` (started at login). Otherwise, operate on `~/Library/LaunchAgents` (started at login).
[`sudo`] `brew services` [`list`] [`sudo`] `brew services` [`list`]:
List all running services for the current user (or root). List all running services for the current user (or root).
[`sudo`] `brew services run` (*`formula`*|`--all`) [`sudo`] `brew services run` (*`formula`*|`--all`):
Run the service *`formula`* without registering to launch at login (or boot). Run the service *`formula`* without registering to launch at login (or boot).
[`sudo`] `brew services start` (*`formula`*|`--all`) [`sudo`] `brew services start` (*`formula`*|`--all`):
Start the service *`formula`* immediately and register it to launch at login (or Start the service *`formula`* immediately and register it to launch at login
boot). (or boot).
[`sudo`] `brew services stop` (*`formula`*|`--all`) [`sudo`] `brew services stop` (*`formula`*|`--all`):
Stop the service *`formula`* immediately and unregister it from launching at Stop the service *`formula`* immediately and unregister it from launching at
login (or boot). login (or boot).
[`sudo`] `brew services restart` (*`formula`*|`--all`) [`sudo`] `brew services restart` (*`formula`*|`--all`):
Stop (if necessary) and start the service *`formula`* immediately and register Stop (if necessary) and start the service *`formula`* immediately and register
it to launch at login (or boot). it to launch at login (or boot).
[`sudo`] `brew services cleanup` [`sudo`] `brew services cleanup`:
Remove all unused services. Remove all unused services.
* `--all`: * `--all`:
Run *`subcommand`* on all services. Run *`subcommand`* on all services.

View File

@ -39,13 +39,19 @@ Perform a substring search of cask tokens and formula names for \fItext\fR\. If
.SH "COMMANDS" .SH "COMMANDS"
. .
.SS "\fBanalytics\fR [\fIsubcommand\fR]" .SS "\fBanalytics\fR [\fIsubcommand\fR]"
If \fBon\fR or \fBoff\fR is passed, turn Homebrew\'s analytics on or off respectively\. Control Homebrew\'s anonymous aggregate user behaviour analytics\. Read more at \fIhttps://docs\.brew\.sh/Analytics\fR\.
. .
.P .P
If \fBstate\fR is passed, display the current anonymous user behaviour analytics state\. Read more at \fIhttps://docs\.brew\.sh/Analytics\fR\. \fBbrew analytics\fR [\fBstate\fR]
Display the current state of Homebrew\'s analytics\.
. .
.P .P
If \fBregenerate\-uuid\fR is passed, regenerate the UUID used in Homebrew\'s analytics\. \fBbrew analytics\fR [\fBon\fR|\fBoff\fR]
Turn Homebrew\'s analytics on or off respectively\.
.
.P
\fBbrew analytics regenerate\-uuid\fR
Regenerate the UUID used for Homebrew\'s analytics\.
. .
.SS "\fBcleanup\fR [\fIoptions\fR] [\fIformula\fR|\fIcask\fR]" .SS "\fBcleanup\fR [\fIoptions\fR] [\fIformula\fR|\fIcask\fR]"
Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae\. If arguments are specified, only do this for the given formulae and casks\. Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae\. If arguments are specified, only do this for the given formulae and casks\.
@ -575,7 +581,7 @@ The variables \fBHOMEBREW_PREFIX\fR, \fBHOMEBREW_CELLAR\fR and \fBHOMEBREW_REPOS
.SS "\fBswitch\fR \fIformula\fR \fIversion\fR" .SS "\fBswitch\fR \fIformula\fR \fIversion\fR"
Symlink all of the specified \fIversion\fR of \fIformula\fR\'s installation into Homebrew\'s prefix\. Symlink all of the specified \fIversion\fR of \fIformula\fR\'s installation into Homebrew\'s prefix\.
. .
.SS "\fBtap\fR [\fIoptions\fR] \fIuser\fR\fB/\fR\fIrepo\fR [\fIURL\fR]" .SS "\fBtap\fR [\fIoptions\fR] [\fIuser\fR\fB/\fR\fIrepo\fR] [\fIURL\fR]"
Tap a formula repository\. Tap a formula repository\.
. .
.P .P
@ -761,7 +767,7 @@ Show the cache file used when pouring a bottle\.
Display Homebrew\'s Cellar path\. \fIDefault:\fR \fB$(brew \-\-prefix)/Cellar\fR, or if that directory doesn\'t exist, \fB$(brew \-\-repository)/Cellar\fR\. Display Homebrew\'s Cellar path\. \fIDefault:\fR \fB$(brew \-\-prefix)/Cellar\fR, or if that directory doesn\'t exist, \fB$(brew \-\-repository)/Cellar\fR\.
. .
.P .P
If \fIformula\fR is provided, display the location in the cellar where \fIformula\fR would be installed, without any sort of versioned directory as the last path\. If \fIformula\fR is provided, display the location in the Cellar where \fIformula\fR would be installed, without any sort of versioned directory as the last path\.
. .
.SS "\fB\-\-env\fR [\fIoptions\fR] [\fIformula\fR]" .SS "\fB\-\-env\fR [\fIoptions\fR] [\fIformula\fR]"
Summarise Homebrew\'s build environment as a plain list\. Summarise Homebrew\'s build environment as a plain list\.
@ -781,7 +787,7 @@ Generate plain output even when piped\.
Display Homebrew\'s install path\. \fIDefault:\fR \fB/usr/local\fR on macOS and \fB/home/linuxbrew/\.linuxbrew\fR on Linux\. Display Homebrew\'s install path\. \fIDefault:\fR \fB/usr/local\fR on macOS and \fB/home/linuxbrew/\.linuxbrew\fR on Linux\.
. .
.P .P
If \fIformula\fR is provided, display the location in the cellar where \fIformula\fR is or would be installed\. If \fIformula\fR is provided, display the location in the Cellar where \fIformula\fR is or would be installed\.
. .
.SS "\fB\-\-repository\fR, \fB\-\-repo\fR [\fIuser\fR\fB/\fR\fIrepo\fR]" .SS "\fB\-\-repository\fR, \fB\-\-repo\fR [\fIuser\fR\fB/\fR\fIrepo\fR]"
Display where Homebrew\'s \fB\.git\fR directory is located\. Display where Homebrew\'s \fB\.git\fR directory is located\.
@ -1089,19 +1095,19 @@ Return a failing status code if changes are detected in the manpage outputs\. Th
This is now done automatically by \fBbrew update\fR\. This is now done automatically by \fBbrew update\fR\.
. .
.SS "\fBpr\-automerge\fR [\fIoptions\fR]" .SS "\fBpr\-automerge\fR [\fIoptions\fR]"
Finds pull requests that can be automatically merged using \fBbrew pr\-publish\fR\. Find pull requests that can be automatically merged using \fBbrew pr\-publish\fR\.
. .
.TP .TP
\fB\-\-tap\fR \fB\-\-tap\fR
Target repository tap (default: \fBhomebrew/core\fR) Target tap repository (default: \fBhomebrew/core\fR)\.
. .
.TP .TP
\fB\-\-with\-label\fR \fB\-\-with\-label\fR
Pull requests must have this label (default: \fBready to merge\fR) Pull requests must have this label (default: \fBready to merge\fR)\.
. .
.TP .TP
\fB\-\-without\-labels\fR \fB\-\-without\-labels\fR
Pull requests must not have these labels (default: \fBdo not merge\fR, \fBnew formula\fR) Pull requests must not have these labels (default: \fBdo not merge\fR, \fBnew formula\fR)\.
. .
.TP .TP
\fB\-\-publish\fR \fB\-\-publish\fR
@ -1112,14 +1118,14 @@ Run \fBbrew pr\-publish\fR on matching pull requests\.
Include pull requests that have failing status checks\. Include pull requests that have failing status checks\.
. .
.SS "\fBpr\-publish\fR [\fIoptions\fR] \fIpull_request\fR [\fIpull_request\fR \.\.\.]" .SS "\fBpr\-publish\fR [\fIoptions\fR] \fIpull_request\fR [\fIpull_request\fR \.\.\.]"
Publishes bottles for a pull request with GitHub Actions\. Requires write access to the repository\. Publish bottles for a pull request with GitHub Actions\. Requires write access to the \fBhomebrew/core\fR repository\.
. .
.SS "\fBpr\-pull\fR [\fIoptions\fR] \fIpull_request\fR [\fIpull_request\fR \.\.\.]" .SS "\fBpr\-pull\fR [\fIoptions\fR] \fIpull_request\fR [\fIpull_request\fR \.\.\.]"
Download and publish bottles, and apply the bottle commit from a pull request with artifacts generated from GitHub Actions\. Requires write access to the repository\. Download and publish bottles, and apply the bottle commit from a pull request with artifacts generated by GitHub Actions\. Requires write access to the repository\.
. .
.TP .TP
\fB\-\-no\-publish\fR \fB\-\-no\-publish\fR
Download the bottles, apply the bottle commit, and upload the bottles to Bintray, but don\'t publish them\. Download the bottles, apply the bottle commit and upload the bottles to Bintray, but don\'t publish them\.
. .
.TP .TP
\fB\-\-no\-upload\fR \fB\-\-no\-upload\fR
@ -1155,7 +1161,7 @@ Upload to the specified Bintray organisation (default: homebrew)\.
. .
.TP .TP
\fB\-\-tap\fR \fB\-\-tap\fR
Target repository tap (default: homebrew/core)\. Target tap repository (default: homebrew/core)\.
. .
.SS "\fBprof\fR \fIcommand\fR" .SS "\fBprof\fR \fIcommand\fR"
Run Homebrew with the Ruby profiler, e\.g\. \fBbrew prof readall\fR\. Run Homebrew with the Ruby profiler, e\.g\. \fBbrew prof readall\fR\.
@ -1164,7 +1170,7 @@ Run Homebrew with the Ruby profiler, e\.g\. \fBbrew prof readall\fR\.
Get a patch from a GitHub commit or pull request and apply it to Homebrew\. Optionally, publish updated bottles for any formulae changed by the patch\. Get a patch from a GitHub commit or pull request and apply it to Homebrew\. Optionally, publish updated bottles for any formulae changed by the patch\.
. .
.P .P
Each \fIpatch\fR may be the number of a pull request in \fBhomebrew/core\fR, the URL of any pull request or commit on GitHub\. Each \fIpatch\fR may be the number of a pull request in \fBhomebrew/core\fR or the URL of any pull request or commit on GitHub\.
. .
.TP .TP
\fB\-\-bump\fR \fB\-\-bump\fR
@ -1343,55 +1349,43 @@ Override warnings and enable potentially unsafe operations\.
. .
.SH "OFFICIAL EXTERNAL COMMANDS" .SH "OFFICIAL EXTERNAL COMMANDS"
. .
.SS "\fBcask\fR \fIsubcommand\fR:" .SS "\fBcask\fR \fIsubcommand\fR"
Install macOS applications distributed as binaries\. See \fBbrew\-cask\fR(1)\. Install macOS applications distributed as binaries\. See \fBbrew\-cask\fR(1)\.
. .
.P .P
\fBHomebrew/homebrew\-cask\fR \fBHomebrew/homebrew\-cask\fR
\fIhttps://github\.com/Homebrew/homebrew\-cask\fR \fIhttps://github\.com/Homebrew/homebrew\-cask\fR
. .
.SS "\fBbundle\fR \fIsubcommand\fR" .SS "\fBbundle\fR [\fIsubcommand\fR]"
Bundler for non\-Ruby dependencies from Homebrew, Homebrew Cask, Mac App Store and Whalebrew\. Bundler for non\-Ruby dependencies from Homebrew, Homebrew Cask, Mac App Store and Whalebrew\.
. .
.P .P
\fBbrew bundle\fR [\fBinstall\fR] \fBbrew bundle\fR [\fBinstall\fR]
. Install or upgrade all dependencies in a \fBBrewfile\fR\.
.P
Install or upgrade all dependencies in a \fBBrewfile\fR\.
. .
.P .P
\fBbrew bundle dump\fR \fBbrew bundle dump\fR
. Write all installed casks/formulae/images/taps into a \fBBrewfile\fR\.
.P
Write all installed casks/formulae/images/taps into a \fBBrewfile\fR\.
. .
.P .P
\fBbrew bundle cleanup\fR \fBbrew bundle cleanup\fR
. Uninstall all dependencies not listed in a \fBBrewfile\fR\.
.P
Uninstall all dependencies not listed in a \fBBrewfile\fR\.
. .
.P .P
\fBbrew bundle check\fR \fBbrew bundle check\fR
. Check if all dependencies are installed in a \fBBrewfile\fR\.
.P
Check if all dependencies are installed in a \fBBrewfile\fR\.
. .
.P .P
\fBbrew bundle exec\fR \fIcommand\fR \fBbrew bundle exec\fR \fIcommand\fR
. Run an external command in an isolated build environment\.
.P
Run an external command in an isolated build environment\.
. .
.P .P
\fBbrew bundle list\fR \fBbrew bundle list\fR
. List all dependencies present in a \fBBrewfile\fR\. By default, only Homebrew dependencies are listed\.
.P
List all dependencies present in a Brewfile\. By default, only Homebrew dependencies are listed\.
. .
.TP .TP
\fB\-\-file\fR \fB\-\-file\fR
Read the \fBBrewfile\fR from this file\. Use \fB\-\-file=\-\fR to pipe to stdin/stdout\. Read the \fBBrewfile\fR from this location\. Use \fB\-\-file=\-\fR to pipe to stdin/stdout\.
. .
.TP .TP
\fB\-\-global\fR \fB\-\-global\fR
@ -1399,7 +1393,7 @@ Read the \fBBrewfile\fR from \fB~/\.Brewfile\fR\.
. .
.TP .TP
\fB\-v\fR, \fB\-\-verbose\fR \fB\-v\fR, \fB\-\-verbose\fR
\fBinstall\fR output is printed from commands as they are run\. \fBcheck\fR prints all missing dependencies\. \fBinstall\fR prints output from commands as they are run\. \fBcheck\fR lists all missing dependencies\.
. .
.TP .TP
\fB\-\-no\-upgrade\fR \fB\-\-no\-upgrade\fR
@ -1407,7 +1401,7 @@ Read the \fBBrewfile\fR from \fB~/\.Brewfile\fR\.
. .
.TP .TP
\fB\-f\fR, \fB\-\-force\fR \fB\-f\fR, \fB\-\-force\fR
\fBdump\fR overwrites an existing \fBBrewfile\fR\. \fBcleanup\fR actually perform the cleanup operations\. \fBdump\fR overwrites an existing \fBBrewfile\fR\. \fBcleanup\fR actually performs its cleanup operations\.
. .
.TP .TP
\fB\-\-no\-lock\fR \fB\-\-no\-lock\fR
@ -1439,7 +1433,7 @@ Read the \fBBrewfile\fR from \fB~/\.Brewfile\fR\.
. .
.TP .TP
\fB\-\-describe\fR \fB\-\-describe\fR
\fBdump\fR a description comment above each line, unless the dependency does not have a description\. \fBdump\fR adds a description comment above each line, unless the dependency does not have a description\.
. .
.TP .TP
\fB\-\-no\-restart\fR \fB\-\-no\-restart\fR
@ -1449,29 +1443,35 @@ Read the \fBBrewfile\fR from \fB~/\.Brewfile\fR\.
\fB\-\-zap\fR \fB\-\-zap\fR
\fBcleanup\fR casks using the \fBzap\fR command instead of \fBuninstall\fR\. \fBcleanup\fR casks using the \fBzap\fR command instead of \fBuninstall\fR\.
. .
.SS "\fBservices\fR \fIsubcommand\fR" .SS "\fBservices\fR [\fIsubcommand\fR]"
Manage background services with macOS\' \fBlaunchctl\fR(1) daemon manager\. Manage background services with macOS\' \fBlaunchctl\fR(1) daemon manager\.
. .
.P .P
If \fBsudo\fR is passed, operate on \fB/Library/LaunchDaemons\fR (started at boot)\. Otherwise, operate on \fB~/Library/LaunchAgents\fR (started at login)\. If \fBsudo\fR is passed, operate on \fB/Library/LaunchDaemons\fR (started at boot)\. Otherwise, operate on \fB~/Library/LaunchAgents\fR (started at login)\.
. .
.P .P
[\fBsudo\fR] \fBbrew services\fR [\fBlist\fR] List all running services for the current user (or root)\. [\fBsudo\fR] \fBbrew services\fR [\fBlist\fR]
List all running services for the current user (or root)\.
. .
.P .P
[\fBsudo\fR] \fBbrew services run\fR (\fIformula\fR|\fB\-\-all\fR) Run the service \fIformula\fR without registering to launch at login (or boot)\. [\fBsudo\fR] \fBbrew services run\fR (\fIformula\fR|\fB\-\-all\fR)
Run the service \fIformula\fR without registering to launch at login (or boot)\.
. .
.P .P
[\fBsudo\fR] \fBbrew services start\fR (\fIformula\fR|\fB\-\-all\fR) Start the service \fIformula\fR immediately and register it to launch at login (or boot)\. [\fBsudo\fR] \fBbrew services start\fR (\fIformula\fR|\fB\-\-all\fR)
Start the service \fIformula\fR immediately and register it to launch at login (or boot)\.
. .
.P .P
[\fBsudo\fR] \fBbrew services stop\fR (\fIformula\fR|\fB\-\-all\fR) Stop the service \fIformula\fR immediately and unregister it from launching at login (or boot)\. [\fBsudo\fR] \fBbrew services stop\fR (\fIformula\fR|\fB\-\-all\fR)
Stop the service \fIformula\fR immediately and unregister it from launching at login (or boot)\.
. .
.P .P
[\fBsudo\fR] \fBbrew services restart\fR (\fIformula\fR|\fB\-\-all\fR) Stop (if necessary) and start the service \fIformula\fR immediately and register it to launch at login (or boot)\. [\fBsudo\fR] \fBbrew services restart\fR (\fIformula\fR|\fB\-\-all\fR)
Stop (if necessary) and start the service \fIformula\fR immediately and register it to launch at login (or boot)\.
. .
.P .P
[\fBsudo\fR] \fBbrew services cleanup\fR Remove all unused services\. [\fBsudo\fR] \fBbrew services cleanup\fR
Remove all unused services\.
. .
.TP .TP
\fB\-\-all\fR \fB\-\-all\fR