diff options
author | Oran Agra <oran@redislabs.com> | 2023-05-15 13:08:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-15 13:08:15 +0300 |
commit | a51eb05b1895babb17c37c36b963e2bcbd5496d5 (patch) | |
tree | 7be24b09e0a5621a03e9f9ffe9ef27fcb44d8345 /src/cli_commands.h | |
parent | e26a769d9627ebecb8607375580970a740348956 (diff) | |
parent | 986dbf716e0cb904c80bb444635cea3242859cc1 (diff) | |
download | redis-7.2.tar.gz |
Diffstat (limited to 'src/cli_commands.h')
-rw-r--r-- | src/cli_commands.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/cli_commands.h b/src/cli_commands.h new file mode 100644 index 000000000..eb5a476e3 --- /dev/null +++ b/src/cli_commands.h @@ -0,0 +1,46 @@ +/* This file is used by redis-cli in place of server.h when including commands.c + * It contains alternative structs which omit the parts of the commands table + * that are not suitable for redis-cli, e.g. the command proc. */ + +#ifndef __REDIS_CLI_COMMANDS_H +#define __REDIS_CLI_COMMANDS_H + +#include <stddef.h> +#include "commands.h" + +/* Syntax specifications for a command argument. */ +typedef struct cliCommandArg { + char *name; + redisCommandArgType type; + char *token; + char *since; + int flags; + int numsubargs; + struct cliCommandArg *subargs; + const char *display_text; + + /* + * For use at runtime. + * Fields used to keep track of input word matches for command-line hinting. + */ + int matched; /* How many input words have been matched by this argument? */ + int matched_token; /* Has the token been matched? */ + int matched_name; /* Has the name been matched? */ + int matched_all; /* Has the whole argument been consumed (no hint needed)? */ +} cliCommandArg; + +/* Command documentation info used for help output */ +struct commandDocs { + char *name; + char *summary; + char *group; + char *since; + int numargs; + cliCommandArg *args; /* An array of the command arguments. */ + struct commandDocs *subcommands; + char *params; /* A string describing the syntax of the command arguments. */ +}; + +extern struct commandDocs redisCommandTable[]; + +#endif |