LCS ... [KEYS ] ... */
| 1827 | |
| 1828 | /* LCS ... [KEYS <key1> <key2>] ... */ |
| 1829 | int lcsGetKeys(struct redisCommand *cmd, robj **argv, int argc, getKeysResult *result) { |
| 1830 | int i; |
| 1831 | int *keys = getKeysPrepareResult(result, 2); |
| 1832 | UNUSED(cmd); |
| 1833 | |
| 1834 | /* We need to parse the options of the command in order to check for the |
| 1835 | * "KEYS" argument before the "STRINGS" argument. */ |
| 1836 | for (i = 1; i < argc; i++) { |
| 1837 | char *arg = argv[i]->ptr; |
| 1838 | int moreargs = (argc-1) - i; |
| 1839 | |
| 1840 | if (!strcasecmp(arg, "strings")) { |
| 1841 | break; |
| 1842 | } else if (!strcasecmp(arg, "keys") && moreargs >= 2) { |
| 1843 | keys[0] = i+1; |
| 1844 | keys[1] = i+2; |
| 1845 | result->numkeys = 2; |
| 1846 | return result->numkeys; |
| 1847 | } |
| 1848 | } |
| 1849 | result->numkeys = 0; |
| 1850 | return result->numkeys; |
| 1851 | } |
| 1852 | |
| 1853 | /* Helper function to extract keys from memory command. |
| 1854 | * MEMORY USAGE <key> */ |
nothing calls this directly
no test coverage detected