aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
authorMarkus Reiter2017-07-24 00:04:43 +0200
committerGitHub2017-07-24 00:04:43 +0200
commitaa8eb21b8c650a2d0a5a060ff27507da60a17bee (patch)
tree8a149b8cd30f43f61b6c1a5c805b106c5eb07f9d /Library/Homebrew/cask/lib
parenta947bfbf47a5d314ab689681c6ef0c42a66ec246 (diff)
parent4e26fdfcf6922dca9a82b15697b4c76c6bf9212b (diff)
downloadbrew-aa8eb21b8c650a2d0a5a060ff27507da60a17bee.tar.bz2
Merge pull request #2861 from reitermarkus/cask-search-tty
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