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

untap: Use CLI::Parser to parse args #5304

Merged
merged 1 commit into from
Nov 14, 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
17 changes: 16 additions & 1 deletion Library/Homebrew/cmd/untap.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
#: * `untap` <tap>:
#: Remove a tapped repository.

require "cli_parser"

module Homebrew
module_function

def untap_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`untap` <tap>

Remove a tapped repository.
EOS
switch :debug
end
end

def untap
raise "Usage is `brew untap <tap-name>`" if ARGV.empty?
untap_args.parse

raise "Usage is `brew untap <tap-name>`" if args.remaining.empty?

ARGV.named.each do |tapname|
tap = Tap.fetch(tapname)
Expand Down