aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-12-26 13:01:52 +0800
committerXu Cheng2015-12-26 13:01:52 +0800
commitc318a9a03e2cf70c946c60e4807813d1efd417a5 (patch)
treef402e24de43e0c4080f39335ca503b46d02bca50 /Library
parent68361be36c52a88c40b3795d8565ce91f4c19714 (diff)
downloadbrew-c318a9a03e2cf70c946c60e4807813d1efd417a5.tar.bz2
tap: improve arguments resolution
* Use `ARGV.include?` instead of `ARGV.first ==`, so users can pass `-v`/`-d` before the function flags(i.e. `--list-pinned` etc) * Restore the ability to call `brew tap --flags tap/name`.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/tap.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb
index 60e789557..774342de5 100644
--- a/Library/Homebrew/cmd/tap.rb
+++ b/Library/Homebrew/cmd/tap.rb
@@ -3,18 +3,18 @@ require "core_formula_repository"
module Homebrew
def tap
- if ARGV.empty?
- puts Tap.names
- elsif ARGV.first == "--repair"
+ if ARGV.include? "--repair"
Tap.each(&:link_manpages)
migrate_taps :force => true
- elsif ARGV.first == "--list-official"
+ elsif ARGV.include? "--list-official"
require "official_taps"
puts OFFICIAL_TAPS.map { |t| "homebrew/#{t}" }
- elsif ARGV.first == "--list-pinned"
+ elsif ARGV.include? "--list-pinned"
puts Tap.select(&:pinned?).map(&:name)
+ elsif ARGV.named.empty?
+ puts Tap.names
else
- tap = Tap.fetch(ARGV[0])
+ tap = Tap.fetch(ARGV.named[0])
begin
tap.install(:clone_target => ARGV.named[1],
:full_clone => ARGV.include?("--full"))