aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
authorMarkus Reiter2017-03-15 14:01:28 +0100
committerGitHub2017-03-15 14:01:28 +0100
commite9e6dcf8930395e4284bbab07b500dd7cb5e5fe5 (patch)
tree330728e40380c2153ab948e6f20ec405b8bc598e /Library/Homebrew/cask/lib
parent7685618a1c110e5430a29c75f44fd3d4aee006e8 (diff)
parent48e4463f5b458c731c6bbbaa200dd805bad32de0 (diff)
downloadbrew-e9e6dcf8930395e4284bbab07b500dd7cb5e5fe5.tar.bz2
Merge pull request #2311 from nath/highlightInstalledCasks
Added highlighting of installed casks to cask search
Diffstat (limited to 'Library/Homebrew/cask/lib')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/search.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/search.rb b/Library/Homebrew/cask/lib/hbc/cli/search.rb
index 3f73fcd2e..992aca583 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/search.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/search.rb
@@ -39,7 +39,7 @@ module Hbc
end
if exact_match
ohai "Exact match"
- puts exact_match
+ puts highlight_installed exact_match
end
return if partial_matches.empty?
@@ -49,7 +49,12 @@ module Hbc
else
ohai "Partial matches"
end
- puts Formatter.columns(partial_matches)
+ puts Formatter.columns(partial_matches.map(&method(:highlight_installed)))
+ end
+
+ def self.highlight_installed(token)
+ return token unless Cask.new(token).installed?
+ pretty_installed token
end
def self.help