diff --git a/Library/Homebrew/abstract_command.rb b/Library/Homebrew/abstract_command.rb index 95b086f022..cd4f299749 100644 --- a/Library/Homebrew/abstract_command.rb +++ b/Library/Homebrew/abstract_command.rb @@ -1,12 +1,15 @@ # typed: strong # frozen_string_literal: true +require "cli/parser" + module Homebrew # Subclass this to implement a `brew` command. This is preferred to declaring a named function in the `Homebrew` # module, because: # - Each Command lives in an isolated namespace. # - Each Command implements a defined interface. # - `args` is available as an ivar, and thus does not need to be passed as an argument to helper methods. + # - Subclasses no longer need to reference CLI::Parser directly. # # To subclass, implement a `run` method and provide a `cmd_args` block to document the command and its allowed args. # To generate method signatures for command args, run `brew typecheck --update`. diff --git a/Library/Homebrew/cmd/analytics.rb b/Library/Homebrew/cmd/analytics.rb index 134fb4b249..6531b823c8 100644 --- a/Library/Homebrew/cmd/analytics.rb +++ b/Library/Homebrew/cmd/analytics.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" module Homebrew module Cmd diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 6e29e4fa37..a7bbe9597e 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -15,7 +15,6 @@ require "style" require "date" require "missing_formula" require "digest" -require "cli/parser" require "json" require "formula_auditor" require "tap_auditor" diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 14462a0d2c..754c3156ef 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -8,7 +8,6 @@ require "utils/bottles" require "tab" require "keg" require "formula_versions" -require "cli/parser" require "utils/inreplace" require "erb" require "utils/gzip" diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index 4f520d67c1..a4552cc767 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -5,7 +5,6 @@ require "abstract_command" require "bump_version_parser" require "cask" require "cask/download" -require "cli/parser" require "utils/tar" module Homebrew diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 2c972aab94..fdbaf0bd4e 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -4,7 +4,6 @@ require "abstract_command" require "fileutils" require "formula" -require "cli/parser" require "utils/pypi" require "utils/tar" diff --git a/Library/Homebrew/dev-cmd/bump-revision.rb b/Library/Homebrew/dev-cmd/bump-revision.rb index 2bbf5b085f..4f83e95d86 100644 --- a/Library/Homebrew/dev-cmd/bump-revision.rb +++ b/Library/Homebrew/dev-cmd/bump-revision.rb @@ -3,7 +3,6 @@ require "abstract_command" require "formula" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb index 47d064ed64..9014f5af52 100644 --- a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb +++ b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb @@ -5,7 +5,6 @@ require "timeout" require "cask/download" require "cask/installer" require "cask/cask_loader" -require "cli/parser" require "system_command" require "tap" require "unversioned_cask_checker" diff --git a/Library/Homebrew/dev-cmd/bump.rb b/Library/Homebrew/dev-cmd/bump.rb index 3de0bd860a..d28eeb62ba 100644 --- a/Library/Homebrew/dev-cmd/bump.rb +++ b/Library/Homebrew/dev-cmd/bump.rb @@ -3,7 +3,6 @@ require "abstract_command" require "bump_version_parser" -require "cli/parser" require "livecheck/livecheck" module Homebrew diff --git a/Library/Homebrew/dev-cmd/cat.rb b/Library/Homebrew/dev-cmd/cat.rb index 8b7bbed67a..a5e8180ca6 100644 --- a/Library/Homebrew/dev-cmd/cat.rb +++ b/Library/Homebrew/dev-cmd/cat.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "fileutils" module Homebrew diff --git a/Library/Homebrew/dev-cmd/command.rb b/Library/Homebrew/dev-cmd/command.rb index 54784a48f0..595e00e4b8 100644 --- a/Library/Homebrew/dev-cmd/command.rb +++ b/Library/Homebrew/dev-cmd/command.rb @@ -3,7 +3,6 @@ require "abstract_command" require "commands" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/contributions.rb b/Library/Homebrew/dev-cmd/contributions.rb index 1e0359a24e..efb00fcd34 100644 --- a/Library/Homebrew/dev-cmd/contributions.rb +++ b/Library/Homebrew/dev-cmd/contributions.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "csv" module Homebrew diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index 75b8a79ac1..089f65a9c5 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -4,7 +4,6 @@ require "formula" require "formula_creator" require "missing_formula" -require "cli/parser" require "utils/pypi" require "cask/cask_loader" diff --git a/Library/Homebrew/dev-cmd/determine-test-runners.rb b/Library/Homebrew/dev-cmd/determine-test-runners.rb index 72a63260a0..cba08ded8e 100644 --- a/Library/Homebrew/dev-cmd/determine-test-runners.rb +++ b/Library/Homebrew/dev-cmd/determine-test-runners.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "test_runner_formula" require "github_runner_matrix" diff --git a/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb b/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb index 29fd01138b..6ec3f3ecc3 100644 --- a/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb +++ b/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "utils/github" module Homebrew diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index 1892d67502..cbea9d7320 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -3,7 +3,6 @@ require "abstract_command" require "formula" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/extract.rb b/Library/Homebrew/dev-cmd/extract.rb index f77505a323..3735541c8a 100644 --- a/Library/Homebrew/dev-cmd/extract.rb +++ b/Library/Homebrew/dev-cmd/extract.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "utils/git" require "formulary" require "software_spec" diff --git a/Library/Homebrew/dev-cmd/formula.rb b/Library/Homebrew/dev-cmd/formula.rb index e0189b4b81..47b0e9783e 100644 --- a/Library/Homebrew/dev-cmd/formula.rb +++ b/Library/Homebrew/dev-cmd/formula.rb @@ -3,7 +3,6 @@ require "abstract_command" require "formula" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/generate-cask-api.rb b/Library/Homebrew/dev-cmd/generate-cask-api.rb index 584f46a6a7..9985ac727b 100644 --- a/Library/Homebrew/dev-cmd/generate-cask-api.rb +++ b/Library/Homebrew/dev-cmd/generate-cask-api.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "cask/cask" require "fileutils" require "formula" diff --git a/Library/Homebrew/dev-cmd/generate-formula-api.rb b/Library/Homebrew/dev-cmd/generate-formula-api.rb index 0036d25bec..5a06a0e0ed 100644 --- a/Library/Homebrew/dev-cmd/generate-formula-api.rb +++ b/Library/Homebrew/dev-cmd/generate-formula-api.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "fileutils" require "formula" diff --git a/Library/Homebrew/dev-cmd/install-bundler-gems.rb b/Library/Homebrew/dev-cmd/install-bundler-gems.rb index 6ac110609d..a4e5956bce 100644 --- a/Library/Homebrew/dev-cmd/install-bundler-gems.rb +++ b/Library/Homebrew/dev-cmd/install-bundler-gems.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index 9da9a012fa..18fcc2e010 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -4,7 +4,6 @@ require "abstract_command" require "formulary" require "cask/cask_loader" -require "cli/parser" class String def f(*args) diff --git a/Library/Homebrew/dev-cmd/linkage.rb b/Library/Homebrew/dev-cmd/linkage.rb index 233b028ab8..23462cc98a 100644 --- a/Library/Homebrew/dev-cmd/linkage.rb +++ b/Library/Homebrew/dev-cmd/linkage.rb @@ -4,7 +4,6 @@ require "abstract_command" require "cache_store" require "linkage_checker" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/livecheck.rb b/Library/Homebrew/dev-cmd/livecheck.rb index c02deece81..6cad963d55 100644 --- a/Library/Homebrew/dev-cmd/livecheck.rb +++ b/Library/Homebrew/dev-cmd/livecheck.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "formula" require "livecheck/livecheck" require "livecheck/strategy" diff --git a/Library/Homebrew/dev-cmd/pr-automerge.rb b/Library/Homebrew/dev-cmd/pr-automerge.rb index 6995de1332..2cfb1b989b 100644 --- a/Library/Homebrew/dev-cmd/pr-automerge.rb +++ b/Library/Homebrew/dev-cmd/pr-automerge.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "utils/github" module Homebrew diff --git a/Library/Homebrew/dev-cmd/pr-publish.rb b/Library/Homebrew/dev-cmd/pr-publish.rb index a6b83183c4..00ba5ca338 100644 --- a/Library/Homebrew/dev-cmd/pr-publish.rb +++ b/Library/Homebrew/dev-cmd/pr-publish.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "utils/github" module Homebrew diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index d6b714819f..da8444543d 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "fileutils" require "utils/github" require "utils/github/artifacts" diff --git a/Library/Homebrew/dev-cmd/pr-upload.rb b/Library/Homebrew/dev-cmd/pr-upload.rb index 540580aae8..7711a141a7 100644 --- a/Library/Homebrew/dev-cmd/pr-upload.rb +++ b/Library/Homebrew/dev-cmd/pr-upload.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "formula" require "github_packages" require "github_releases" diff --git a/Library/Homebrew/dev-cmd/prof.rb b/Library/Homebrew/dev-cmd/prof.rb index 1242b3eace..c0389d60ef 100644 --- a/Library/Homebrew/dev-cmd/prof.rb +++ b/Library/Homebrew/dev-cmd/prof.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/release.rb b/Library/Homebrew/dev-cmd/release.rb index 75fbab3511..badf7ca582 100644 --- a/Library/Homebrew/dev-cmd/release.rb +++ b/Library/Homebrew/dev-cmd/release.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/ruby.rb b/Library/Homebrew/dev-cmd/ruby.rb index db071c75a6..db9c9be93c 100644 --- a/Library/Homebrew/dev-cmd/ruby.rb +++ b/Library/Homebrew/dev-cmd/ruby.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/sh.rb b/Library/Homebrew/dev-cmd/sh.rb index 6b295dfd93..e4c35c85c6 100644 --- a/Library/Homebrew/dev-cmd/sh.rb +++ b/Library/Homebrew/dev-cmd/sh.rb @@ -4,7 +4,6 @@ require "abstract_command" require "extend/ENV" require "formula" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/style.rb b/Library/Homebrew/dev-cmd/style.rb index 58de7af85b..3182430c86 100644 --- a/Library/Homebrew/dev-cmd/style.rb +++ b/Library/Homebrew/dev-cmd/style.rb @@ -5,7 +5,6 @@ require "abstract_command" require "json" require "open3" require "style" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index 1c36553ec0..bb8099a07b 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -4,7 +4,6 @@ require "abstract_command" require "fileutils" require "tap" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/test.rb b/Library/Homebrew/dev-cmd/test.rb index b7f2b8dc2f..de847d0ae0 100644 --- a/Library/Homebrew/dev-cmd/test.rb +++ b/Library/Homebrew/dev-cmd/test.rb @@ -5,7 +5,6 @@ require "abstract_command" require "extend/ENV" require "sandbox" require "timeout" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index fb948c1013..16c30ef90f 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "fileutils" require "system_command" diff --git a/Library/Homebrew/dev-cmd/typecheck.rb b/Library/Homebrew/dev-cmd/typecheck.rb index 4789caa7df..b836b68e57 100644 --- a/Library/Homebrew/dev-cmd/typecheck.rb +++ b/Library/Homebrew/dev-cmd/typecheck.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "fileutils" module Homebrew diff --git a/Library/Homebrew/dev-cmd/unbottled.rb b/Library/Homebrew/dev-cmd/unbottled.rb index df18a3a21f..359724dfbb 100644 --- a/Library/Homebrew/dev-cmd/unbottled.rb +++ b/Library/Homebrew/dev-cmd/unbottled.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "formula" require "api" require "os/mac/xcode" diff --git a/Library/Homebrew/dev-cmd/unpack.rb b/Library/Homebrew/dev-cmd/unpack.rb index dcf50f2899..8ecc1c1f2e 100644 --- a/Library/Homebrew/dev-cmd/unpack.rb +++ b/Library/Homebrew/dev-cmd/unpack.rb @@ -5,7 +5,6 @@ require "abstract_command" require "fileutils" require "stringio" require "formula" -require "cli/parser" module Homebrew module DevCmd diff --git a/Library/Homebrew/dev-cmd/update-license-data.rb b/Library/Homebrew/dev-cmd/update-license-data.rb index c68fe365e7..5d2ed16ac7 100644 --- a/Library/Homebrew/dev-cmd/update-license-data.rb +++ b/Library/Homebrew/dev-cmd/update-license-data.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "utils/spdx" require "system_command" diff --git a/Library/Homebrew/dev-cmd/update-maintainers.rb b/Library/Homebrew/dev-cmd/update-maintainers.rb index 1bb8734f55..e21aef44e2 100644 --- a/Library/Homebrew/dev-cmd/update-maintainers.rb +++ b/Library/Homebrew/dev-cmd/update-maintainers.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "utils/github" require "manpages" require "system_command" diff --git a/Library/Homebrew/dev-cmd/update-python-resources.rb b/Library/Homebrew/dev-cmd/update-python-resources.rb index 50fc287cbe..865103698f 100644 --- a/Library/Homebrew/dev-cmd/update-python-resources.rb +++ b/Library/Homebrew/dev-cmd/update-python-resources.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "utils/pypi" module Homebrew diff --git a/Library/Homebrew/dev-cmd/update-sponsors.rb b/Library/Homebrew/dev-cmd/update-sponsors.rb index 8d213a503f..248a290413 100644 --- a/Library/Homebrew/dev-cmd/update-sponsors.rb +++ b/Library/Homebrew/dev-cmd/update-sponsors.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "utils/github" require "system_command" diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index 0c2c42a131..c2b637f686 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" require "fileutils" module Homebrew diff --git a/Library/Homebrew/dev-cmd/vendor-gems.rb b/Library/Homebrew/dev-cmd/vendor-gems.rb index 063fb9242e..792a218be1 100644 --- a/Library/Homebrew/dev-cmd/vendor-gems.rb +++ b/Library/Homebrew/dev-cmd/vendor-gems.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require "abstract_command" -require "cli/parser" module Homebrew module DevCmd