oh1: Add a truncate option
This commit is contained in:
		
							parent
							
								
									33912e218e
								
							
						
					
					
						commit
						2b847959f0
					
				@ -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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user