Merge pull request #5295 from GauthamGoli/tap-unpin-args
tap-unpin: Use CLI::Parser to parse args
This commit is contained in:
commit
9d61c95dba
@ -1,10 +1,25 @@
|
|||||||
#: * `tap-unpin` <tap>:
|
#: * `tap-unpin` <tap>:
|
||||||
#: Unpin <tap> so its formulae are no longer prioritized. See also `tap-pin`.
|
#: Unpin <tap> so its formulae are no longer prioritized. See also `tap-pin`.
|
||||||
|
|
||||||
|
require "cli_parser"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
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
|
def tap_unpin
|
||||||
|
tap_unpin_args.parse
|
||||||
|
|
||||||
ARGV.named.each do |name|
|
ARGV.named.each do |name|
|
||||||
tap = Tap.fetch(name)
|
tap = Tap.fetch(name)
|
||||||
raise "unpinning #{tap} is not allowed" if tap.core_tap?
|
raise "unpinning #{tap} is not allowed" if tap.core_tap?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user