Commit 6573acbd authored by Binbin's avatar Binbin Committed by Oran Agra
Browse files

Support NO ONE block in REPLICAOF command json (#12633)

The current commands.json doesn't mention the special NO ONE arguments.
This change is also applied to SLAVEOF

(cherry picked from commit 8d92f7f2)
parent 8ada737f
...@@ -4917,13 +4917,33 @@ struct redisCommandArg PSYNC_Args[] = { ...@@ -4917,13 +4917,33 @@ struct redisCommandArg PSYNC_Args[] = {
/* REPLICAOF tips */ /* REPLICAOF tips */
#define REPLICAOF_tips NULL #define REPLICAOF_tips NULL
/* REPLICAOF argument table */ /* REPLICAOF args host_port argument table */
struct redisCommandArg REPLICAOF_Args[] = { struct redisCommandArg REPLICAOF_args_host_port_Subargs[] = {
{"host",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE}, {"host",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"port",ARG_TYPE_INTEGER,-1,NULL,NULL,NULL,CMD_ARG_NONE}, {"port",ARG_TYPE_INTEGER,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{0} {0}
}; };
/* REPLICAOF args no_one argument table */
struct redisCommandArg REPLICAOF_args_no_one_Subargs[] = {
{"no",ARG_TYPE_PURE_TOKEN,-1,"NO",NULL,NULL,CMD_ARG_NONE},
{"one",ARG_TYPE_PURE_TOKEN,-1,"ONE",NULL,NULL,CMD_ARG_NONE},
{0}
};
/* REPLICAOF args argument table */
struct redisCommandArg REPLICAOF_args_Subargs[] = {
{"host-port",ARG_TYPE_BLOCK,-1,NULL,NULL,NULL,CMD_ARG_NONE,.subargs=REPLICAOF_args_host_port_Subargs},
{"no-one",ARG_TYPE_BLOCK,-1,NULL,NULL,NULL,CMD_ARG_NONE,.subargs=REPLICAOF_args_no_one_Subargs},
{0}
};
/* REPLICAOF argument table */
struct redisCommandArg REPLICAOF_Args[] = {
{"args",ARG_TYPE_ONEOF,-1,NULL,NULL,NULL,CMD_ARG_NONE,.subargs=REPLICAOF_args_Subargs},
{0}
};
/********** RESTORE_ASKING ********************/ /********** RESTORE_ASKING ********************/
/* RESTORE_ASKING history */ /* RESTORE_ASKING history */
...@@ -5000,13 +5020,33 @@ struct redisCommandArg SHUTDOWN_Args[] = { ...@@ -5000,13 +5020,33 @@ struct redisCommandArg SHUTDOWN_Args[] = {
/* SLAVEOF tips */ /* SLAVEOF tips */
#define SLAVEOF_tips NULL #define SLAVEOF_tips NULL
/* SLAVEOF argument table */ /* SLAVEOF args host_port argument table */
struct redisCommandArg SLAVEOF_Args[] = { struct redisCommandArg SLAVEOF_args_host_port_Subargs[] = {
{"host",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE}, {"host",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"port",ARG_TYPE_INTEGER,-1,NULL,NULL,NULL,CMD_ARG_NONE}, {"port",ARG_TYPE_INTEGER,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{0} {0}
}; };
/* SLAVEOF args no_one argument table */
struct redisCommandArg SLAVEOF_args_no_one_Subargs[] = {
{"no",ARG_TYPE_PURE_TOKEN,-1,"NO",NULL,NULL,CMD_ARG_NONE},
{"one",ARG_TYPE_PURE_TOKEN,-1,"ONE",NULL,NULL,CMD_ARG_NONE},
{0}
};
/* SLAVEOF args argument table */
struct redisCommandArg SLAVEOF_args_Subargs[] = {
{"host-port",ARG_TYPE_BLOCK,-1,NULL,NULL,NULL,CMD_ARG_NONE,.subargs=SLAVEOF_args_host_port_Subargs},
{"no-one",ARG_TYPE_BLOCK,-1,NULL,NULL,NULL,CMD_ARG_NONE,.subargs=SLAVEOF_args_no_one_Subargs},
{0}
};
/* SLAVEOF argument table */
struct redisCommandArg SLAVEOF_Args[] = {
{"args",ARG_TYPE_ONEOF,-1,NULL,NULL,NULL,CMD_ARG_NONE,.subargs=SLAVEOF_args_Subargs},
{0}
};
/********** SLOWLOG GET ********************/ /********** SLOWLOG GET ********************/
/* SLOWLOG GET history */ /* SLOWLOG GET history */
......
...@@ -14,12 +14,40 @@ ...@@ -14,12 +14,40 @@
], ],
"arguments": [ "arguments": [
{ {
"name": "host", "name": "args",
"type": "string" "type": "oneof",
}, "arguments": [
{ {
"name": "port", "name": "host-port",
"type": "integer" "type": "block",
"arguments": [
{
"name": "host",
"type": "string"
},
{
"name": "port",
"type": "integer"
}
]
},
{
"name": "no-one",
"type": "block",
"arguments": [
{
"name": "no",
"type": "pure-token",
"token": "NO"
},
{
"name": "one",
"type": "pure-token",
"token": "ONE"
}
]
}
]
} }
] ]
} }
......
...@@ -19,12 +19,40 @@ ...@@ -19,12 +19,40 @@
], ],
"arguments": [ "arguments": [
{ {
"name": "host", "name": "args",
"type": "string" "type": "oneof",
}, "arguments": [
{ {
"name": "port", "name": "host-port",
"type": "integer" "type": "block",
"arguments": [
{
"name": "host",
"type": "string"
},
{
"name": "port",
"type": "integer"
}
]
},
{
"name": "no-one",
"type": "block",
"arguments": [
{
"name": "no",
"type": "pure-token",
"token": "NO"
},
{
"name": "one",
"type": "pure-token",
"token": "ONE"
}
]
}
]
} }
] ]
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment