Cluster: redis-trib help output improved.

Show options if any. Clarify that for some command any node address is
ok.
This commit is contained in:
antirez 2014-01-16 16:23:28 +01:00
parent 595ab5f26b
commit 2c9f8fc22b

View File

@ -857,12 +857,18 @@ ALLOWED_OPTIONS={
}
def show_help
puts "Usage: redis-trib <command> <options> <arguments ...>"
puts
puts "Usage: redis-trib <command> <options> <arguments ...>\n\n"
COMMANDS.each{|k,v|
puts " #{k.ljust(10)} #{v[2]}"
o = ""
if ALLOWED_OPTIONS[k]
ALLOWED_OPTIONS[k].each{|optname,has_arg|
o += "--#{optname}" + (has_arg ? " <arg>" : "") + " "
}
end
o = "[#{o.strip}]" if o.length > 0
puts " #{k.ljust(10)} #{v[2]} #{o}"
}
puts
puts "\nFor check, fix, reshard, you can specify host:port of any working node.\n"
end
# Sanity check