Port Homebrew::Cmd::Config

This commit is contained in:
Douglas Eichelberger 2024-03-29 16:31:23 -07:00
parent b97f9b22e2
commit 3615e5e648
2 changed files with 16 additions and 18 deletions

View File

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

View File

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