mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
redis-trib: initial output colorization
This commit is contained in:
parent
797d98e906
commit
4286d8b979
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user