spring-shell
spring-shell copied to clipboard
Get and process raw commands entered by the user
I hope that an interface can be added before parameter parsing, the function is to obtain and process the original command input by the user.
Here is an example, User input is select * from user where username = 'test'.
After the program parses the parameters, the single quotes are removed.
User must enter select * from user where username = "'test'".
it is very inconvenient.
You've probably misunderstood how terminal works with spring-shell or generally speaking with any other commands a terminal runs.
Lets take an example of a bash in linux:
$ echo foo
foo
$ echo "foo"
foo
$ echo 'foo'
foo
$ echo \'foo\'
'foo'
$ echo \"foo\"
"foo"
$ echo "'foo'"
'foo'
It's a terminal which removes your single or double quotes. You can use escape to keep your quotes or use double quotes with single guotes which will be preserved.
When parsing line into words in the source code of spring shell, single quotes are removed

I hope you can provide this parsing process to developers
Ah so you might have been using interactive mode where things are more or less processed via jline library. I think they made it work remarkable same as normal bash processing.
We could try to look if this can somehow easily tuned by a user but I already know what works for one user, doesn't work for other user. Quotes, double quotes and escaping things has always been a bit annoyance in shell apps. Default functionality will always be so that you can use same command string in both interactive and non-interactive modes.
But yes having some kind of raw mode in interactive mode might be a way to go. Thanks clarifying this use case!