redis-trib: initial output colorization

This commit is contained in:
antirez 2013-03-25 12:50:38 +01:00
parent 797d98e906
commit 4286d8b979

View File

@ -27,7 +27,23 @@ require 'redis'
ClusterHashSlots = 16384
def xputs(s)
puts s
case s[0..2]
when ">>>"
color="29;1"
when "[ER"
color="31;1"
when "[OK"
color="32"
when "[FA","***"
color="33"
else
color=nil
end
print "\033[#{color}m" if color
print s
print "\033[0m" if color
print "\n"
end
class ClusterNode