Merge pull request #5303 from GauthamGoli/unpin-args

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

View File

@ -3,12 +3,28 @@
#: See also `pin`.
require "formula"
require "cli_parser"
module Homebrew
module_function
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
def unpin
raise FormulaUnspecifiedError if ARGV.named.empty?
unpin_args.parse
raise FormulaUnspecifiedError if args.remaining.empty?
ARGV.resolved_formulae.each do |f|
if f.pinned?