Added highlighting of installed casks to cask search
This commit is contained in:
parent
394f9fa0aa
commit
d305784c37
@ -39,7 +39,7 @@ module Hbc
|
|||||||
end
|
end
|
||||||
if exact_match
|
if exact_match
|
||||||
ohai "Exact match"
|
ohai "Exact match"
|
||||||
puts exact_match
|
puts highlight_installed exact_match
|
||||||
end
|
end
|
||||||
|
|
||||||
return if partial_matches.empty?
|
return if partial_matches.empty?
|
||||||
@ -49,7 +49,8 @@ module Hbc
|
|||||||
else
|
else
|
||||||
ohai "Partial matches"
|
ohai "Partial matches"
|
||||||
end
|
end
|
||||||
puts Formatter.columns(partial_matches)
|
highlighted = partial_matches.map { |match| highlight_installed match }
|
||||||
|
puts Formatter.columns(highlighted)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.help
|
def self.help
|
||||||
|
@ -36,6 +36,14 @@ def odebug(title, *sput)
|
|||||||
puts sput unless sput.empty?
|
puts sput unless sput.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def highlight_installed(token)
|
||||||
|
cask = Hbc.load(token)
|
||||||
|
if cask.installed?
|
||||||
|
token = pretty_installed token
|
||||||
|
end
|
||||||
|
token
|
||||||
|
end
|
||||||
|
|
||||||
module Hbc
|
module Hbc
|
||||||
module Utils
|
module Utils
|
||||||
def self.gain_permissions_remove(path, command: SystemCommand)
|
def self.gain_permissions_remove(path, command: SystemCommand)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user