From 683c2b64f27d051dcc6a11dd5b5bac8c7ef356bc Mon Sep 17 00:00:00 2001 From: Gautham Goli Date: Sat, 10 Nov 2018 22:54:32 +0530 Subject: [PATCH] tap-pin: Use CLI::Parser to parse args --- Library/Homebrew/cmd/tap-pin.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Library/Homebrew/cmd/tap-pin.rb b/Library/Homebrew/cmd/tap-pin.rb index 6d18eba4d6..7878d550f2 100644 --- a/Library/Homebrew/cmd/tap-pin.rb +++ b/Library/Homebrew/cmd/tap-pin.rb @@ -2,10 +2,26 @@ #: Pin , prioritizing its formulae over core when formula names are supplied #: by the user. See also `tap-unpin`. +require "cli_parser" + module Homebrew module_function + def tap_pin_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `tap-pin` + + Pin , prioritizing its formulae over core when formula names are supplied + by the user. See also `tap-unpin`. + EOS + switch :debug + end + end + def tap_pin + tap_pin_args.parse + ARGV.named.each do |name| tap = Tap.fetch(name) raise "pinning #{tap} is not allowed" if tap.core_tap?