Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move doc metadata from COMMAND to COMMAND DOCS #10056

Merged
merged 13 commits into from
Jan 11, 2022
15 changes: 15 additions & 0 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -3804,6 +3804,20 @@ struct redisCommandArg BGSAVE_Args[] = {
/* COMMAND COUNT hints */
#define COMMAND_COUNT_Hints NULL

/********** COMMAND DETAILS ********************/
oranagra marked this conversation as resolved.
Show resolved Hide resolved

/* COMMAND DETAILS history */
#define COMMAND_DETAILS_History NULL

/* COMMAND DETAILS hints */
#define COMMAND_DETAILS_Hints NULL

/* COMMAND DETAILS argument table */
struct redisCommandArg COMMAND_DETAILS_Args[] = {
{"command-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_OPTIONAL|CMD_ARG_MULTIPLE},
{0}
};

/********** COMMAND GETKEYS ********************/

/* COMMAND GETKEYS history */
Expand Down Expand Up @@ -3859,6 +3873,7 @@ struct redisCommandArg COMMAND_LIST_Args[] = {
/* COMMAND command table */
struct redisCommand COMMAND_Subcommands[] = {
{"count","Get total number of Redis commands","O(1)","2.8.13",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SERVER,COMMAND_COUNT_History,COMMAND_COUNT_Hints,commandCountCommand,2,CMD_LOADING|CMD_STALE,ACL_CATEGORY_CONNECTION},
{"details","Get array of specific Redis command documentation","O(N) when N is number of commands to look up","7.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SERVER,COMMAND_DETAILS_History,COMMAND_DETAILS_Hints,commandDetailsCommand,-2,CMD_LOADING|CMD_STALE,ACL_CATEGORY_CONNECTION,.args=COMMAND_DETAILS_Args},
{"getkeys","Extract keys given a full Redis command","O(N) where N is the number of arguments to the command","2.8.13",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SERVER,COMMAND_GETKEYS_History,COMMAND_GETKEYS_Hints,commandGetKeysCommand,-4,CMD_LOADING|CMD_STALE,ACL_CATEGORY_CONNECTION},
{"help","Show helpful text about the different subcommands","O(1)","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SERVER,COMMAND_HELP_History,COMMAND_HELP_Hints,commandHelpCommand,2,CMD_LOADING|CMD_STALE,ACL_CATEGORY_CONNECTION},
{"info","Get array of specific Redis command details","O(N) when N is number of commands to look up","2.8.13",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SERVER,COMMAND_INFO_History,COMMAND_INFO_Hints,commandInfoCommand,-3,CMD_LOADING|CMD_STALE,ACL_CATEGORY_CONNECTION,.args=COMMAND_INFO_Args},
Expand Down
26 changes: 26 additions & 0 deletions src/commands/command-details.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"DETAILS": {
"summary": "Get array of specific Redis command documentation",
"complexity": "O(N) when N is number of commands to look up",
"group": "server",
"since": "7.0.0",
"arity": -2,
"container": "COMMAND",
"function": "commandDetailsCommand",
"command_flags": [
"LOADING",
"STALE"
],
"acl_categories": [
"CONNECTION"
],
"arguments": [
{
"name": "command-name",
"type": "string",
"optional": true,
"multiple": true
}
]
}
}
Loading