Repository: redis/redis

Issue:
[BUG] `redis-cli --cluster create` reports different errors when trying to create a cluster with lesser than 3 master nodes
**Describe the bug**

Hi!

When using redis-cli 7.2.3, running `redis-cli --cluster create` with less than three nodes results in an error on the standard output. This is because redis-cli requires at least three master nodes to create a cluster. The error message is unclear when only one node is given. However, this issue does not occur when two or more nodes are used.

For the case when only one node is given, I suggest to output the same error message as when two nodes are given.

**To reproduce**

1. Start two redis-server instances that listen at 7000 and 7001 ports.

2. Run the following commands:

```
$ redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 --cluster-replicas 0
*** ERROR: Invalid configuration for cluster creation.
*** Redis Cluster requires at least 3 master nodes.
*** This is not possible with 2 nodes and 0 replicas per node.
*** At least 3 nodes are required.
$ redis-cli --cluster create 127.0.0.1:7000 --cluster-replicas 0
[ERR] Wrong number of arguments for specified --cluster sub command
```

**Expected behavior**

I suggest something like this:

```
$ redis-cli --cluster create 127.0.0.1:7000 --cluster-replicas 0
*** ERROR: Invalid configuration for cluster creation.
*** Redis Cluster requires at least 3 master nodes.
*** This is not possible with 1 nodes and 0 replicas per node.
*** At least 3 nodes are required.
```



Discussion:
thanks for the report, this make sense to me, the error message is friendly.

Patch:
diff --git a/src/redis-cli.c b/src/redis-cli.c
index 930582dd957..ed6f59001a1 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -3765,7 +3765,7 @@ typedef struct clusterManagerCommandDef {
 } clusterManagerCommandDef;
 
 clusterManagerCommandDef clusterManagerCommands[] = {
-    {"create", clusterManagerCommandCreate, -2, "host1:port1 ... hostN:portN",
+    {"create", clusterManagerCommandCreate, -1, "host1:port1 ... hostN:portN",
      "replicas <arg>"},
     {"check", clusterManagerCommandCheck, -1, "<host:port> or <host> <port> - separated by either colon or space",
      "search-multiple-owners"},