diff options
author | antirez <antirez@gmail.com> | 2013-02-27 18:02:22 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-02-27 18:02:22 +0100 |
commit | 64942fca01c67d36a28bfe1703e75d0dbfc19272 (patch) | |
tree | e466881cb4948e9b82bfc0e001a5bfe3ac5f28fe /src/redis-trib.rb | |
parent | d45d184118326bb33c0768338f801f7cbab2d363 (diff) | |
download | redis-64942fca01c67d36a28bfe1703e75d0dbfc19272.tar.gz |
redis-trib help.
Diffstat (limited to 'src/redis-trib.rb')
-rwxr-xr-x | src/redis-trib.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/redis-trib.rb b/src/redis-trib.rb index e9ab94b4e..e06925c7d 100755 --- a/src/redis-trib.rb +++ b/src/redis-trib.rb @@ -599,6 +599,11 @@ class RedisTrib puts "Send CLUSTER MEET to node #{new} to make it join the cluster." new.r.cluster("meet",first[:host],first[:port]) end + + def help_cluster_cmd + show_help + exit 0 + end end COMMANDS={ @@ -606,17 +611,22 @@ COMMANDS={ "check" => ["check_cluster_cmd", 2, "host:port"], "fix" => ["fix_cluster_cmd", 2, "host:port"], "reshard" => ["reshard_cluster_cmd", 2, "host:port"], - "addnode" => ["addnode_cluster_cmd", 3, "new_host:new_port existing_host:existing_port"] + "addnode" => ["addnode_cluster_cmd", 3, "new_host:new_port existing_host:existing_port"], + "help" => ["help_cluster_cmd", 1, "(show this help)"] } -# Sanity check -if ARGV.length == 0 +def show_help puts "Usage: redis-trib <command> <arguments ...>" puts COMMANDS.each{|k,v| puts " #{k.ljust(10)} #{v[2]}" } puts +end + +# Sanity check +if ARGV.length == 0 + show_help exit 1 end |