2016-04-08 16:28:43 +02:00
|
|
|
#: * `unpin` <formulae>:
|
2018-10-06 00:31:10 -04:00
|
|
|
#: Unpin <formulae>, allowing them to be upgraded by `brew upgrade` <formulae>.
|
2017-08-11 17:23:11 +01:00
|
|
|
#: See also `pin`.
|
2016-04-08 16:28:43 +02:00
|
|
|
|
2015-08-03 13:09:07 +01:00
|
|
|
require "formula"
|
2018-11-11 18:23:14 +05:30
|
|
|
require "cli_parser"
|
2013-03-11 16:41:08 +01:00
|
|
|
|
2014-06-18 22:41:47 -05:00
|
|
|
module Homebrew
|
2016-09-26 01:44:51 +02:00
|
|
|
module_function
|
|
|
|
|
2018-11-11 18:23:14 +05:30
|
|
|
def unpin_args
|
|
|
|
Homebrew::CLI::Parser.new do
|
|
|
|
usage_banner <<~EOS
|
|
|
|
`unpin` <formulae>
|
|
|
|
|
|
|
|
Unpin <formulae>, allowing them to be upgraded by `brew upgrade` <formulae>.
|
|
|
|
See also `pin`.
|
|
|
|
EOS
|
|
|
|
switch :verbose
|
|
|
|
switch :debug
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-03-11 16:41:08 +01:00
|
|
|
def unpin
|
2018-11-11 18:23:14 +05:30
|
|
|
unpin_args.parse
|
|
|
|
|
|
|
|
raise FormulaUnspecifiedError if args.remaining.empty?
|
2013-04-16 01:43:26 -05:00
|
|
|
|
2015-05-17 21:14:37 +08:00
|
|
|
ARGV.resolved_formulae.each do |f|
|
2013-04-16 01:43:26 -05:00
|
|
|
if f.pinned?
|
|
|
|
f.unpin
|
|
|
|
elsif !f.pinnable?
|
|
|
|
onoe "#{f.name} not installed"
|
|
|
|
else
|
|
|
|
opoo "#{f.name} not pinned"
|
|
|
|
end
|
2013-03-11 16:41:08 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|