info: highlight package name

This commit is contained in:
fn ⌃ ⌥ 2022-08-12 23:44:45 -07:00
parent 63ced67928
commit a208ea9c92
3 changed files with 8 additions and 4 deletions

View File

@ -79,7 +79,7 @@ module Cask
end end
def self.title_info(cask) def self.title_info(cask)
title = "#{cask.token}: #{cask.version}" title = "#{oh1_title(cask.token)}: #{cask.version}"
title += " (auto_updates)" if cask.auto_updates title += " (auto_updates)" if cask.auto_updates
title title
end end

View File

@ -274,7 +274,7 @@ module Homebrew
attrs << "pinned at #{f.pinned_version}" if f.pinned? attrs << "pinned at #{f.pinned_version}" if f.pinned?
attrs << "keg-only" if f.keg_only? attrs << "keg-only" if f.keg_only?
puts "#{f.full_name}: #{specs * ", "}#{" [#{attrs * ", "}]" unless attrs.empty?}" puts "#{oh1_title(f.full_name)}: #{specs * ", "}#{" [#{attrs * ", "}]" unless attrs.empty?}"
puts f.desc if f.desc puts f.desc if f.desc
puts Formatter.url(f.homepage) if f.homepage puts Formatter.url(f.homepage) if f.homepage

View File

@ -125,7 +125,7 @@ module Kernel
puts sput unless sput.empty? puts sput unless sput.empty?
end end
def oh1(title, truncate: :auto) def oh1_title(title, truncate: :auto)
verbose = if respond_to?(:verbose?) verbose = if respond_to?(:verbose?)
verbose? verbose?
else else
@ -133,7 +133,11 @@ module Kernel
end end
title = Tty.truncate(title) if $stdout.tty? && !verbose && truncate == :auto title = Tty.truncate(title) if $stdout.tty? && !verbose && truncate == :auto
puts Formatter.headline(title, color: :green) Formatter.headline(title, color: :green)
end
def oh1(title, truncate: :auto)
puts oh1_title(title, truncate: truncate)
end end
# Print a message prefixed with "Warning" (do this rarely). # Print a message prefixed with "Warning" (do this rarely).