From 2b847959f098414fb12600535b5f0ab584a11e40 Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Wed, 10 Aug 2016 13:17:26 -0400 Subject: oh1: Add a truncate option --- Library/Homebrew/utils.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Library/Homebrew/utils.rb') diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index f78fbfcb7..71f03c6d5 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -88,8 +88,10 @@ def ohai(title, *sput) puts sput end -def oh1(title) - title = Tty.truncate(title) if $stdout.tty? && !ARGV.verbose? +def oh1(title, options = {}) + if $stdout.tty? && !ARGV.verbose? && options.fetch(:truncate, :auto) == :auto + title = Tty.truncate(title) + end puts "#{Tty.green}==>#{Tty.white} #{title}#{Tty.reset}" end -- cgit v1.2.3