• Jason Elbaum's avatar
    Reimplement cli hints based on command arg docs (#10515) · 1f76bb17
    Jason Elbaum authored
    Now that the command argument specs are available at runtime (#9656), this PR addresses
    #8084 by implementing a complete solution for command-line hinting in `redis-cli`.
    
    It correctly handles nearly every case in Redis's complex command argument definitions, including
    `BLOCK` and `ONEOF` arguments, reordering of optional arguments, and repeated arguments
    (even when followed by mandatory arguments). It also validates numerically-typed arguments.
    It may not correctly handle all possible combinations of those, but overall it is quite robust.
    
    Arguments are only matched after the space bar is typed, so partial word matching is not
    supported - that proved to be more confusing than helpful. When the user's current input
    cannot be matched against the argument specs, hinting is disabled.
    
    Partial support has been implemented for legacy (pre-7.0) servers that do not support
    `COMMAND DOCS`, by falling back to a statically-compiled command argume...
    1f76bb17
commands.c 756 Bytes