From e8ceda3ad8c84c5b9f61ba521dcadeebbc16b612 Mon Sep 17 00:00:00 2001 From: Gautham Goli Date: Sun, 11 Nov 2018 18:23:14 +0530 Subject: [PATCH] unpin: Use CLI::Parser to parse args --- Library/Homebrew/cmd/unpin.rb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/unpin.rb b/Library/Homebrew/cmd/unpin.rb index 73dd19a066..4f4da23d43 100644 --- a/Library/Homebrew/cmd/unpin.rb +++ b/Library/Homebrew/cmd/unpin.rb @@ -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` + + Unpin , allowing them to be upgraded by `brew upgrade` . + 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?