Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tap-pin: Use CLI::Parser to parse args #5294

Merged
merged 1 commit into from
Nov 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions Library/Homebrew/cmd/tap-pin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,26 @@
#: Pin <tap>, 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` <tap>

Pin <tap>, 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?
Expand Down