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

Support quoted strings for old inline protocol #7

Open
clue opened this issue Jan 31, 2014 · 1 comment
Open

Support quoted strings for old inline protocol #7

clue opened this issue Jan 31, 2014 · 1 comment

Comments

@clue
Copy link
Owner

clue commented Jan 31, 2014

The old inline protocol is mostly obsolete, but some kind of support for this would still be nice:

set "a" "abc"

Afaict, redis 2.8 added support for quotes, whereas redis 2.6 actually added a key named "a" with a valud of "abc" (yes, both including the quotes).

@clue
Copy link
Owner Author

clue commented Oct 8, 2016

I've just released a rather sophisticated command line parser which can in fact parse the above commands just fine: https://github.com/clue/php-arguments

However, the Redis' inline protocol parser actually has some quirks I'm not sure we should try to reproduce here.

  • In particular, the string "he"llo is rejected, while `he"llo" is accepted (whitespace required only after quotes, not around). This differs from usual terminal interpretation where missing whitespace is actually ignores so this resolves to a single argument.
  • Unquoted values do not accept any escape characters at all.
  • An empty argument "" is ignored instead of accepting this as an empty string.

Arguably, these are certainly edge cases and unlikely what you average user would send.
It looks like some of these could actually be considered bugs rather than features, so I'm currently undecided what we should do here.

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

No branches or pull requests

1 participant