cmd/dev-cmd: misc. usage and wording fixes

This commit is contained in:
EricFromCanada 2020-04-18 12:13:43 -04:00
parent b6809f2dda
commit 9d6eb41fc5
15 changed files with 41 additions and 46 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

@ -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).