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

Accept lowercase SCRIPT subcommands #987

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

prvyk
Copy link
Contributor

@prvyk prvyk commented Feb 1, 2025

script load return -> ERR unknown command
SCRIPT LOAD return -> "63143b6f8007b98c53ca2149822777b3566f9241"
SCRIPT load return -> ERR unknown command
script LOAD return -> "63143b6f8007b98c53ca2149822777b3566f9241"

What happens is that the second pass uppercases SCRIPT, but can't uppercase the subcommand. Later the 'fast' check only checks the uppercase FLUSH/EXISTS/LOAD.

Solve this by adding the script command also to the 'slow' parsing step. This handles all the mixed-cases and matches the MEMORY command handling, while retaining 'fast' parsing for uppercase subcommands. Garnet already does the 'you get slightly slower parsing if you do lowercase' tradeoff .

The second commit standardizes subcommand 'slow' handling a bit: always the correct error message when no subcommand and subcommand is required, always the correct error message when non-supported subcommand is used. Add and use an error message not mentioning HELP subcommand when that subcommand is not implemented.

@badrishc
Copy link
Contributor

badrishc commented Feb 5, 2025

could you resolve conflicts with main?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants