Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
4286d8b9
Commit
4286d8b9
authored
Mar 25, 2013
by
antirez
Browse files
redis-trib: initial output colorization
parent
797d98e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
4286d8b9
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment