oh1: Add a truncate option

This commit is contained in:
Shaun Jackman 2016-08-10 13:17:26 -04:00
parent 33912e218e
commit 2b847959f0

View File

@ -88,8 +88,10 @@ def ohai(title, *sput)
puts sput puts sput
end end
def oh1(title) def oh1(title, options = {})
title = Tty.truncate(title) if $stdout.tty? && !ARGV.verbose? if $stdout.tty? && !ARGV.verbose? && options.fetch(:truncate, :auto) == :auto
title = Tty.truncate(title)
end
puts "#{Tty.green}==>#{Tty.white} #{title}#{Tty.reset}" puts "#{Tty.green}==>#{Tty.white} #{title}#{Tty.reset}"
end end