Merge pull request #5569 from GauthamGoli/config-args

config: Use CLI::Parser to parse args
This commit is contained in:
Gautham Goli 2019-01-22 18:59:38 +05:30 committed by GitHub
commit aea6bb78f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,11 +4,28 @@
#: provide it.
require "system_config"
require "cli_parser"
module Homebrew
module_function
def config_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`config`
Show Homebrew and system configuration useful for debugging. If you file
a bug report, you will likely be asked for this information if you do not
provide it.
EOS
switch :verbose
switch :debug
end
end
def config
config_args.parse
raise UsageError unless args.remaining.empty?
SystemConfig.dump_verbose_config
end
end