mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use colorize.rb for non-capable terminals
This commit is contained in:
parent
2e7fe3b687
commit
7806b2e28b
1 changed files with 6 additions and 1 deletions
|
@ -212,6 +212,10 @@ if ARGV.size != 3
|
|||
abort "Usage: #{$0} <c-compiler> <header file> <out>"
|
||||
end
|
||||
|
||||
if STDOUT.tty?
|
||||
require_relative 'lib/colorize'
|
||||
color = Colorize.new
|
||||
end
|
||||
cc = ARGV[0]
|
||||
code = File.binread(ARGV[1]) # Current version of the header file.
|
||||
outfile = ARGV[2]
|
||||
|
@ -317,5 +321,6 @@ messages = {
|
|||
skipped: 'SKIPPED to transform',
|
||||
}
|
||||
transform_logs.each do |key, decl_names|
|
||||
puts("#{PROGRAM}: #{messages.fetch(key)}: #{decl_names.map { |s| "\e[1m#{s}\e[0m" }.join(', ')}")
|
||||
decl_names = decl_names.map { |s| color.bold(s) } if color
|
||||
puts("#{PROGRAM}: #{messages.fetch(key)}: #{decl_names.join(', ')}")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue