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 8d92f7f2b7)
This commit is contained in:
Binbin 2023-10-10 03:10:40 -05:00 committed by Oran Agra
parent 8ada737f0a
commit 6573acbd73
3 changed files with 112 additions and 16 deletions

View File

@ -4917,13 +4917,33 @@ struct redisCommandArg PSYNC_Args[] = {
/* REPLICAOF tips */
#define REPLICAOF_tips NULL
/* REPLICAOF argument table */
struct redisCommandArg REPLICAOF_Args[] = {
/* REPLICAOF args host_port argument table */
struct redisCommandArg REPLICAOF_args_host_port_Subargs[] = {
{"host",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"port",ARG_TYPE_INTEGER,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{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 history */
@ -5000,13 +5020,33 @@ struct redisCommandArg SHUTDOWN_Args[] = {
/* SLAVEOF tips */
#define SLAVEOF_tips NULL
/* SLAVEOF argument table */
struct redisCommandArg SLAVEOF_Args[] = {
/* SLAVEOF args host_port argument table */
struct redisCommandArg SLAVEOF_args_host_port_Subargs[] = {
{"host",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"port",ARG_TYPE_INTEGER,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{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 history */

View File

@ -14,12 +14,40 @@
],
"arguments": [
{
"name": "host",
"type": "string"
},
{
"name": "port",
"type": "integer"
"name": "args",
"type": "oneof",
"arguments": [
{
"name": "host-port",
"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"
}
]
}
]
}
]
}

View File

@ -19,12 +19,40 @@
],
"arguments": [
{
"name": "host",
"type": "string"
},
{
"name": "port",
"type": "integer"
"name": "args",
"type": "oneof",
"arguments": [
{
"name": "host-port",
"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"
}
]
}
]
}
]
}