diff --git a/src/cluster.c b/src/cluster.c index 2da0f54f..2c9866d0 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -4065,7 +4065,34 @@ void clusterCommand(client *c) { return; } - if (!strcasecmp(c->argv[1]->ptr,"meet") && (c->argc == 4 || c->argc == 5)) { + if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) { + const char *help[] = { + "addslots [slot ...] -- Assign slots to current node.", + "bumpepoch -- Advance the cluster config epoch.", + "count-failure-reports -- Return number of failure reports for .", + "countkeysinslot - Return the number of keys in .", + "delslots [slot ...] -- Delete slots information from current node.", + "failover [force|takeover] -- Promote current slave node to being a master.", + "forget -- Remove a node from the cluster.", + "getkeysinslot -- Return key names stored by current node in a slot.", + "flushslots -- Delete current node own slots information.", + "info - Return onformation about the cluster.", + "keyslot -- Return the hash slot for .", + "meet [bus-port] -- Connect nodes into a working cluster.", + "myid -- Return the node id.", + "nodes -- Return cluster configuration seen by node. Output format:", + " ... ", + "replicate -- Configure current node as slave to .", + "reset [hard|soft] -- Reset current node (default: soft).", + "set-config-epoch - Set config epoch of current node.", + "setslot (importing|migrating|stable|node ) -- Set slot state.", + "slaves -- Return slaves.", + "slots -- Return information about slots range mappings. Each range is made of:", + " start, end, master and replicas IP addresses, ports and ids", + NULL + }; + addReplyHelp(c, help); + } else if (!strcasecmp(c->argv[1]->ptr,"meet") && (c->argc == 4 || c->argc == 5)) { /* CLUSTER MEET [cport] */ long long port, cport; @@ -4258,7 +4285,7 @@ void clusterCommand(client *c) { clusterAddSlot(n,slot); } else { addReplyError(c, - "Invalid CLUSTER SETSLOT action or number of arguments"); + "Invalid CLUSTER SETSLOT action or number of arguments. Try CLUSTER help"); return; } clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|CLUSTER_TODO_UPDATE_STATE); @@ -4608,7 +4635,9 @@ void clusterCommand(client *c) { clusterReset(hard); addReply(c,shared.ok); } else { - addReplyError(c,"Wrong CLUSTER subcommand or number of arguments"); + addReplyErrorFormat(c, "Unknown subcommand or wrong number of arguments for '%s'. Try CLUSTER help", + (char*)c->argv[1]->ptr); + return; } }