diff --git a/Library/Homebrew/cmd/--cellar.rb b/Library/Homebrew/cmd/--cellar.rb index 59f8e64f30..4b1367cf67 100644 --- a/Library/Homebrew/cmd/--cellar.rb +++ b/Library/Homebrew/cmd/--cellar.rb @@ -13,7 +13,7 @@ module Homebrew Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if that directory doesn't exist, `$(brew --repository)/Cellar`. - If is provided, display the location in the cellar where + If is provided, display the location in the Cellar where would be installed, without any sort of versioned directory as the last path. EOS end diff --git a/Library/Homebrew/cmd/--prefix.rb b/Library/Homebrew/cmd/--prefix.rb index e9b24b07b8..5269e38d9e 100644 --- a/Library/Homebrew/cmd/--prefix.rb +++ b/Library/Homebrew/cmd/--prefix.rb @@ -13,7 +13,7 @@ module Homebrew Display Homebrew's install path. *Default:* `/usr/local` on macOS and `/home/linuxbrew/.linuxbrew` on Linux. - If is provided, display the location in the cellar where + If is provided, display the location in the Cellar where is or would be installed. EOS end diff --git a/Library/Homebrew/cmd/log.rb b/Library/Homebrew/cmd/log.rb index 538fe4b1c1..ffee96f468 100644 --- a/Library/Homebrew/cmd/log.rb +++ b/Library/Homebrew/cmd/log.rb @@ -29,7 +29,7 @@ module Homebrew def log 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. ENV["PATH"] = ENV["HOMEBREW_PATH"] diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index addde2b4af..bdd396cae2 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -8,7 +8,7 @@ module Homebrew def tap_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `tap` [] `/` [] + `tap` [] [`/`] [] Tap a formula repository. @@ -36,8 +36,7 @@ module Homebrew description: "Migrate tapped formulae from symlink-based to directory-based structure." switch "--list-pinned", description: "List all pinned taps." - switch :quiet, - description: "Suppress any warnings." + switch :quiet switch :debug max_named 2 end diff --git a/Library/Homebrew/cmd/unpin.rb b/Library/Homebrew/cmd/unpin.rb index 255cc86172..4daed2ea06 100644 --- a/Library/Homebrew/cmd/unpin.rb +++ b/Library/Homebrew/cmd/unpin.rb @@ -16,14 +16,13 @@ module Homebrew EOS switch :verbose switch :debug + min_named :formula end end def unpin unpin_args.parse - raise FormulaUnspecifiedError if args.no_named? - args.resolved_formulae.each do |f| if f.pinned? f.unpin diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 1eac5573d3..c08997c8aa 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -109,7 +109,7 @@ module Homebrew def bump_formula_pr 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. ENV["PATH"] = ENV["HOMEBREW_PATH"] diff --git a/Library/Homebrew/dev-cmd/bump-revision.rb b/Library/Homebrew/dev-cmd/bump-revision.rb index ccc44085af..5070520752 100644 --- a/Library/Homebrew/dev-cmd/bump-revision.rb +++ b/Library/Homebrew/dev-cmd/bump-revision.rb @@ -22,21 +22,18 @@ module Homebrew switch :quiet switch :verbose switch :debug - max_named 1 + named :formula end end def bump_revision 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. ENV["PATH"] = ENV["HOMEBREW_PATH"] - formulae = args.formulae - raise FormulaUnspecifiedError if formulae.empty? - - formula = formulae.first + formula = args.formulae.first current_revision = formula.revision if current_revision.zero? diff --git a/Library/Homebrew/dev-cmd/mirror.rb b/Library/Homebrew/dev-cmd/mirror.rb index b12bb8c1f7..bba48a7be0 100644 --- a/Library/Homebrew/dev-cmd/mirror.rb +++ b/Library/Homebrew/dev-cmd/mirror.rb @@ -10,7 +10,7 @@ module Homebrew usage_banner <<~EOS `mirror` - 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 switch :verbose switch :debug diff --git a/Library/Homebrew/dev-cmd/pr-automerge.rb b/Library/Homebrew/dev-cmd/pr-automerge.rb index 8f81cedf15..471cfc2c7e 100644 --- a/Library/Homebrew/dev-cmd/pr-automerge.rb +++ b/Library/Homebrew/dev-cmd/pr-automerge.rb @@ -11,20 +11,21 @@ module Homebrew usage_banner <<~EOS `pr-automerge` [] - 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 - flag "--tap=", - description: "Target repository tap (default: `homebrew/core`)" - flag "--with-label=", - description: "Pull requests must have this label (default: `ready to merge`)" + flag "--tap=", + description: "Target tap repository (default: `homebrew/core`)." + flag "--with-label=", + description: "Pull requests must have this label (default: `ready to merge`)." 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", description: "Run `brew pr-publish` on matching pull requests." switch "--ignore-failures", description: "Include pull requests that have failing status checks." - switch :debug switch :verbose + switch :debug + max_named 0 end end @@ -57,8 +58,7 @@ module Homebrew if args.publish? safe_system "#{HOMEBREW_PREFIX}/bin/brew", "pr-publish", *pr_urls else - ohai "Now run:" - puts " brew pr-publish \\\n #{pr_urls.join " \\\n "}" + ohai "Now run:", " brew pr-publish \\\n #{pr_urls.join " \\\n "}" end end end diff --git a/Library/Homebrew/dev-cmd/pr-publish.rb b/Library/Homebrew/dev-cmd/pr-publish.rb index dcb18a7e3c..d45ab8c185 100644 --- a/Library/Homebrew/dev-cmd/pr-publish.rb +++ b/Library/Homebrew/dev-cmd/pr-publish.rb @@ -11,10 +11,11 @@ module Homebrew usage_banner <<~EOS `pr-publish` [] [ ...] - 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 `homebrew/core` repository. EOS switch :verbose + min_named 1 end end @@ -23,8 +24,6 @@ module Homebrew 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| arg = "#{CoreTap.instance.default_remote}/pull/#{arg}" if arg.to_i.positive? url_match = arg.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index 74562d1ca3..039f52cc2a 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -15,32 +15,32 @@ module Homebrew `pr-pull` [] [ ...] 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. EOS 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." switch "--no-upload", description: "Download the bottles and apply the bottle commit, "\ "but don't upload to Bintray." - switch "--dry-run", "-n", + switch "-n", "--dry-run", description: "Print what would be done rather than doing it." switch "--clean", description: "Do not amend the commits from pull requests." switch "--branch-okay", description: "Do not warn if pulling to a branch besides master (useful for testing)." switch "--resolve", - description: "When a patch fails to apply, leave in progress and allow user to resolve, instead "\ - "of aborting." - flag "--workflow=", - description: "Retrieve artifacts from the specified workflow (default: tests.yml)." - flag "--artifact=", - description: "Download artifacts with the specified name (default: bottles)." - flag "--bintray-org=", - description: "Upload to the specified Bintray organisation (default: homebrew)." - flag "--tap=", - description: "Target repository tap (default: homebrew/core)." + description: "When a patch fails to apply, leave in progress and allow user to resolve, "\ + "instead of aborting." + flag "--workflow=", + description: "Retrieve artifacts from the specified workflow (default: tests.yml)." + flag "--artifact=", + description: "Download artifacts with the specified name (default: bottles)." + flag "--bintray-org=", + description: "Upload to the specified Bintray organisation (default: homebrew)." + flag "--tap=", + description: "Target tap repository (default: homebrew/core)." switch :verbose switch :debug min_named 1 diff --git a/Library/Homebrew/dev-cmd/prof.rb b/Library/Homebrew/dev-cmd/prof.rb index aba6de4749..d5134d3150 100644 --- a/Library/Homebrew/dev-cmd/prof.rb +++ b/Library/Homebrew/dev-cmd/prof.rb @@ -12,6 +12,7 @@ module Homebrew Run Homebrew with the Ruby profiler, e.g. `brew prof readall`. EOS + min_named 1 end end diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb index f6f7b3ac30..930bd75a89 100644 --- a/Library/Homebrew/dev-cmd/pull.rb +++ b/Library/Homebrew/dev-cmd/pull.rb @@ -22,8 +22,8 @@ module 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. - Each may be the number of a pull request in `homebrew/core`, the URL of any pull request - or commit on GitHub. + Each may be the number of a pull request in `homebrew/core` + or the URL of any pull request or commit on GitHub. EOS switch "--bump", description: "For one-formula PRs, automatically reword commit message to our preferred format." diff --git a/Library/Homebrew/dev-cmd/unpack.rb b/Library/Homebrew/dev-cmd/unpack.rb index 236e369a3f..2aeaaf54ce 100644 --- a/Library/Homebrew/dev-cmd/unpack.rb +++ b/Library/Homebrew/dev-cmd/unpack.rb @@ -26,6 +26,7 @@ module Homebrew switch :verbose switch :debug conflicts "--git", "--patch" + min_named :formula end end @@ -33,7 +34,6 @@ module Homebrew unpack_args.parse formulae = args.formulae - raise FormulaUnspecifiedError if formulae.empty? if dir = args.destdir unpack_dir = Pathname.new(dir).expand_path diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb index 26d439a213..ac68c57dc0 100644 --- a/Library/Homebrew/manpages/brew.1.md.erb +++ b/Library/Homebrew/manpages/brew.1.md.erb @@ -65,7 +65,7 @@ If no search term is provided, all locally available formulae are listed. ## OFFICIAL EXTERNAL COMMANDS -### `cask` : +### `cask` Install macOS applications distributed as binaries. See `brew-cask`(1).