summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-12-12 13:17:56 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-12-12 23:32:37 +0900
commite809bd31fd7877ea4e302c18cbd42f1b2d685728 (patch)
treeea9e4475618d5a5baa8fb16063529d4cd91f9e71 /tool
parent0ba65c689e27b0b6229fbb40fc6794d0c853a33f (diff)
Fix positional argument color [ci skip]
Diffstat (limited to 'tool')
-rw-r--r--tool/lib/colorize.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/lib/colorize.rb b/tool/lib/colorize.rb
index f11137cfdf..467cd21246 100644
--- a/tool/lib/colorize.rb
+++ b/tool/lib/colorize.rb
@@ -6,7 +6,7 @@ class Colorize
# Colorize.new(color: color, colors_file: colors_file)
def initialize(color = nil, opts = ((_, color = color, nil)[0] if Hash === color))
@colors = @reset = nil
- @color = (opts[:color] if opts)
+ @color = opts && opts[:color] || color
if color or (color == nil && STDOUT.tty? && (ENV["NO_COLOR"] || "").empty?)
if (%w[smso so].any? {|attr| /\A\e\[.*m\z/ =~ IO.popen("tput #{attr}", "r", :err => IO::NULL, &:read)} rescue nil)
@beg = "\e["