From 9531c84807910e0d85e34e6bbadecec587371355 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 16 Jan 2014 16:23:28 +0100 Subject: [PATCH] Cluster: redis-trib help output improved. Show options if any. Clarify that for some command any node address is ok. --- src/redis-trib.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/redis-trib.rb b/src/redis-trib.rb index 9c06c22ab..46c95c9ba 100755 --- a/src/redis-trib.rb +++ b/src/redis-trib.rb @@ -857,12 +857,18 @@ ALLOWED_OPTIONS={ } def show_help - puts "Usage: redis-trib " - puts + puts "Usage: redis-trib \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 ? " " : "") + " " + } + 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