From 0eecbb21fa5df8c52078c55702f134f27ea2ec1f Mon Sep 17 00:00:00 2001 From: Gautham Goli Date: Sun, 20 Jan 2019 21:29:19 +0530 Subject: [PATCH] config: Use CLI::Parser to parse args --- Library/Homebrew/cmd/config.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Library/Homebrew/cmd/config.rb b/Library/Homebrew/cmd/config.rb index daaa51f32b..44b6ec6198 100644 --- a/Library/Homebrew/cmd/config.rb +++ b/Library/Homebrew/cmd/config.rb @@ -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