tap-unpin: Use CLI::Parser to parse args

This commit is contained in:
Gautham Goli 2018-11-10 23:31:23 +05:30
parent a8aed381ca
commit 12040c2525
No known key found for this signature in database
GPG Key ID: 6A9ABBC284468364

View File

@ -1,10 +1,25 @@
#: * `tap-unpin` <tap>:
#: Unpin <tap> so its formulae are no longer prioritized. See also `tap-pin`.
require "cli_parser"
module Homebrew
module_function
def tap_unpin_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`tap-unpin` <tap>
Unpin <tap> so its formulae are no longer prioritized. See also `tap-pin`.
EOS
switch :debug
end
end
def tap_unpin
tap_unpin_args.parse
ARGV.named.each do |name|
tap = Tap.fetch(name)
raise "unpinning #{tap} is not allowed" if tap.core_tap?