diff --git a/Library/Homebrew/cmd/config.rb b/Library/Homebrew/cmd/config.rb index d75bc5ce54..515139b7ee 100644 --- a/Library/Homebrew/cmd/config.rb +++ b/Library/Homebrew/cmd/config.rb @@ -1,28 +1,25 @@ # typed: strict # frozen_string_literal: true +require "abstract_command" require "system_config" -require "cli/parser" module Homebrew - module_function + module Cmd + class Config < AbstractCommand + cmd_args do + description <<~EOS + Show Homebrew and system configuration info useful for debugging. If you file + a bug report, you will be required to provide this information. + EOS - sig { returns(CLI::Parser) } - def config_args - Homebrew::CLI::Parser.new do - description <<~EOS - Show Homebrew and system configuration info useful for debugging. If you file - a bug report, you will be required to provide this information. - EOS + named_args :none + end - named_args :none + sig { override.void } + def run + SystemConfig.dump_verbose_config + end end end - - sig { void } - def config - config_args.parse - - SystemConfig.dump_verbose_config - end end diff --git a/Library/Homebrew/test/cmd/config_spec.rb b/Library/Homebrew/test/cmd/config_spec.rb index d5621f4541..9abdc63405 100644 --- a/Library/Homebrew/test/cmd/config_spec.rb +++ b/Library/Homebrew/test/cmd/config_spec.rb @@ -1,8 +1,9 @@ # frozen_string_literal: true +require "cmd/config" require "cmd/shared_examples/args_parse" -RSpec.describe "brew config" do +RSpec.describe Homebrew::Cmd::Config do it_behaves_like "parseable arguments" it "prints information about the current Homebrew configuration", :integration_test do