untap: Use CLI::Parser to parse args

This commit is contained in:
Gautham Goli 2018-11-11 18:35:55 +05:30
parent b0f382c177
commit e70df22acd
No known key found for this signature in database
GPG Key ID: 6A9ABBC284468364

View File

@ -1,11 +1,26 @@
#: * `untap` <tap>: #: * `untap` <tap>:
#: Remove a tapped repository. #: Remove a tapped repository.
require "cli_parser"
module Homebrew module Homebrew
module_function module_function
def untap_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`untap` <tap>
Remove a tapped repository.
EOS
switch :debug
end
end
def untap def untap
raise "Usage is `brew untap <tap-name>`" if ARGV.empty? untap_args.parse
raise "Usage is `brew untap <tap-name>`" if args.remaining.empty?
ARGV.named.each do |tapname| ARGV.named.each do |tapname|
tap = Tap.fetch(tapname) tap = Tap.fetch(tapname)