diff options
Diffstat (limited to 'src/db.c')
-rw-r--r-- | src/db.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -1554,6 +1554,32 @@ int *georadiusGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numk return keys; } +/* LCS ... [KEYS <key1> <key2>] ... */ +int *lcsGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) +{ + int i; + int *keys = getKeysTempBuffer; + UNUSED(cmd); + + /* We need to parse the options of the command in order to check for the + * "KEYS" argument before the "STRINGS" argument. */ + for (i = 1; i < argc; i++) { + char *arg = argv[i]->ptr; + int moreargs = (argc-1) - i; + + if (!strcasecmp(arg, "strings")) { + break; + } else if (!strcasecmp(arg, "keys") && moreargs >= 2) { + keys[0] = i+1; + keys[1] = i+2; + *numkeys = 2; + return keys; + } + } + *numkeys = 0; + return keys; +} + /* Helper function to extract keys from memory command. * MEMORY USAGE <key> */ int *memoryGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) { |