Port Homebrew::Cmd::Config
This commit is contained in:
parent
b97f9b22e2
commit
3615e5e648
@ -1,28 +1,25 @@
|
|||||||
# typed: strict
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "abstract_command"
|
||||||
require "system_config"
|
require "system_config"
|
||||||
require "cli/parser"
|
|
||||||
|
|
||||||
module Homebrew
|
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) }
|
named_args :none
|
||||||
def config_args
|
end
|
||||||
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
|
sig { override.void }
|
||||||
|
def run
|
||||||
|
SystemConfig.dump_verbose_config
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { void }
|
|
||||||
def config
|
|
||||||
config_args.parse
|
|
||||||
|
|
||||||
SystemConfig.dump_verbose_config
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "cmd/config"
|
||||||
require "cmd/shared_examples/args_parse"
|
require "cmd/shared_examples/args_parse"
|
||||||
|
|
||||||
RSpec.describe "brew config" do
|
RSpec.describe Homebrew::Cmd::Config do
|
||||||
it_behaves_like "parseable arguments"
|
it_behaves_like "parseable arguments"
|
||||||
|
|
||||||
it "prints information about the current Homebrew configuration", :integration_test do
|
it "prints information about the current Homebrew configuration", :integration_test do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user