Merge pull request #5304 from GauthamGoli/untap-args

untap: Use CLI::Parser to parse args
This commit is contained in:
Gautham Goli 2018-11-14 12:48:40 +05:30 committed by GitHub
commit 8118cd4a38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)