2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-04-17 18:25:08 +09:00
|
|
|
require "cli/parser"
|
2018-11-11 18:35:55 +05:30
|
|
|
|
2014-06-18 22:41:47 -05:00
|
|
|
module Homebrew
|
2016-09-26 01:44:51 +02:00
|
|
|
module_function
|
|
|
|
|
2018-11-11 18:35:55 +05:30
|
|
|
def untap_args
|
|
|
|
Homebrew::CLI::Parser.new do
|
|
|
|
usage_banner <<~EOS
|
|
|
|
`untap` <tap>
|
|
|
|
|
2019-08-19 22:44:50 -04:00
|
|
|
Remove a tapped formula repository.
|
2018-11-11 18:35:55 +05:30
|
|
|
EOS
|
|
|
|
switch :debug
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-03-02 20:28:54 +00:00
|
|
|
def untap
|
2018-11-11 18:35:55 +05:30
|
|
|
untap_args.parse
|
|
|
|
|
2019-12-13 15:39:55 -05:00
|
|
|
raise UsageError, "This command requires a tap argument from `brew tap`'s list" if args.remaining.empty?
|
2013-03-02 06:52:55 -05:00
|
|
|
|
2015-06-08 18:05:58 +08:00
|
|
|
ARGV.named.each do |tapname|
|
2015-12-07 14:11:04 +08:00
|
|
|
tap = Tap.fetch(tapname)
|
2019-12-13 15:39:55 -05:00
|
|
|
odie "Untapping #{tap} is not allowed" if tap.core_tap?
|
2018-09-17 02:45:00 +02:00
|
|
|
|
2015-11-07 16:25:34 +08:00
|
|
|
tap.uninstall
|
2015-02-01 12:11:54 -05:00
|
|
|
end
|
2012-03-18 00:40:41 +00:00
|
|
|
end
|
2012-03-02 20:28:54 +00:00
|
|
|
end
|