From 43c6061bc95d8e21803b227181f716e6926e28f4 Mon Sep 17 00:00:00 2001
From: Xu Cheng <xucheng@me.com>
Date: Thu, 25 Feb 2016 21:09:50 +0800
Subject: [PATCH] Tap#install: support quiet option

---
 Library/Homebrew/tap.rb | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index b1bc9ab0b7..8519a3c6d6 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -140,17 +140,21 @@ class Tap
   # @param [Hash] options
   # @option options [String]  :clone_targe If passed, it will be used as the clone remote.
   # @option options [Boolean] :full_clone If set as true, full clone will be used.
+  # @option options [Boolean] :quiet If set, suppress all output.
   def install(options = {})
     require "descriptions"
     raise TapAlreadyTappedError, name if installed?
     clear_cache
 
+    quiet = options.fetch(:quiet, false)
+
     # ensure git is installed
     Utils.ensure_git_installed!
-    ohai "Tapping #{name}"
+    ohai "Tapping #{name}" unless quiet
     remote = options[:clone_target] || "https://github.com/#{user}/homebrew-#{repo}"
     args = %W[clone #{remote} #{path}]
     args << "--depth=1" unless options.fetch(:full_clone, false)
+    args << "-q" if quiet
 
     begin
       safe_system "git", *args
@@ -165,10 +169,10 @@ class Tap
     link_manpages
 
     formula_count = formula_files.size
-    puts "Tapped #{formula_count} formula#{plural(formula_count, "e")} (#{path.abv})"
+    puts "Tapped #{formula_count} formula#{plural(formula_count, "e")} (#{path.abv})" unless quiet
     Descriptions.cache_formulae(formula_names)
 
-    if !options[:clone_target] && private?
+    if !options[:clone_target] && private? && !quiet
       puts <<-EOS.undent
         It looks like you tapped a private repository. To avoid entering your
         credentials each time you update, you can use git HTTP credential
-- 
GitLab