aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
authorMarkus Reiter2017-07-06 01:08:59 +0200
committerMarkus Reiter2017-07-07 19:42:03 +0200
commitd29cb450f729fc88ba045c68e3b70e86cdecfaec (patch)
tree7581133b5ef4707c5e29b1e2b9841e76c4981d5f /Library/Homebrew/cask/lib
parent8ec08479ae71a849ea1e648ccda7a85771c14d01 (diff)
downloadbrew-d29cb450f729fc88ba045c68e3b70e86cdecfaec.tar.bz2
Output plain list when running `brew cask search` without a TTY.
Diffstat (limited to 'Library/Homebrew/cask/lib')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/search.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/search.rb b/Library/Homebrew/cask/lib/hbc/cli/search.rb
index 9d1a16f15..643d18d55 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/search.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/search.rb
@@ -46,6 +46,11 @@ module Hbc
end
def self.render_results(exact_match, partial_matches, remote_matches, search_term)
+ unless $stdout.tty?
+ puts [*exact_match, *partial_matches, *remote_matches]
+ return
+ end
+
if !exact_match && partial_matches.empty?
puts "No Cask found for \"#{search_term}\"."
return