You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a configuration that can enable/disable block comment processing #488
In 1.2.0.RELEASE spring shell tends to erase everything between block command quotes.
However sometime we do not need this feature as we might need to pass a URL regex like '*/*/*'. If doing so, spring shell will keep characters before last '/*' and after last '*/'. As a result we get '*/**', which is buggy.
I suggest we had better introduce a configuration that can enable/disable block comment processing.
The problem is, when we pass */*/* as the parameter 'str' but actually we get */**。
It seems this feature cannot be turned off . The relevant code block is:
AbstractShell::executeCommand:
// We support simple block comments; ie a single pair per lineif (!inBlockComment && line.contains("/*") && line.contains("*/")) {
blockCommentBegin();
Stringlhs = line.substring(0, line.lastIndexOf("/*"));
if (line.contains("*/")) {
line = lhs + line.substring(line.lastIndexOf("*/") + 2);
blockCommentFinish();
} else {
line = lhs;
}
}
if (inBlockComment) {
if (!line.contains("*/")) {
returnnewCommandResult(true);
}
blockCommentFinish();
line = line.substring(line.lastIndexOf("*/") + 2);
}
// We also support inline comments (but only at start of line, otherwise valid// command options like http://www.helloworld.com will fail as per ROO-517)if (!inBlockComment && (line.trim().startsWith("//") || line.trim().startsWith("#"))) { // # support in ROO-1116line = "";
}
Also I got two more questions and need some help:
Can spring shell 2.1.0 temporarily turn off this feature by centain configuration?
It seems that 2.1.0 version works with spring boot, but we prefer a light-weight implementation. I prefer to upgrade but have to take it into consideration.
This is from hoodie right? Unfortunately you are on an unsupported stack here as this is such an old code. Part of that code in shell 1.x code originates from spring roo(which means we're talking 10+ years). Spring Boot then became later which these days is the bootstrapping framework.
If you need to fix something on spring-shell 1.x I think only option is to fork it and make needed quick fixes to give more time for possible rework/overhaul on top of more modern spring-shell.
Since early days of spring shell 1.x it has been rewritten two times so very little is in place these days. What comes for your question 1, it's not valid as offending code is not there anymore.
About your question 2; Spring shell 1.x used spring-framework as spring-boot didn't exist at that time, thus the Bootstrap you have. You'd be surprised how good solution spring-shell is with spring-boot as there's been a years of maintenance in a framework itself.
Also if you choose to migrate, you have a good path forward to keep dependencies up-to-date, get a change to be on a supported versions from both spring and jdk.
Activity
jvalkeal commentedon Jul 29, 2022
1.2.0.RELEASEis 6 years old release so can you try2.1.0.To you question I have a hard time to understand what you mean. Is this about command file? Can you show a real example what happens with a shell.
paul8263 commentedon Jul 29, 2022
Hi @jvalkeal ,
Thank you very much for your reply.
It is about command line param. As shown in the example below:
The problem is, when we pass
*/*/*as the parameter 'str' but actually we get*/**。It seems this feature cannot be turned off . The relevant code block is:
AbstractShell::executeCommand:
Also I got two more questions and need some help:
jvalkeal commentedon Jul 29, 2022
This is from hoodie right? Unfortunately you are on an unsupported stack here as this is such an old code. Part of that code in shell 1.x code originates from spring roo(which means we're talking 10+ years). Spring Boot then became later which these days is the bootstrapping framework.
If you need to fix something on spring-shell 1.x I think only option is to fork it and make needed quick fixes to give more time for possible rework/overhaul on top of more modern spring-shell.
Since early days of spring shell 1.x it has been rewritten two times so very little is in place these days. What comes for your question 1, it's not valid as offending code is not there anymore.
About your question 2; Spring shell 1.x used spring-framework as spring-boot didn't exist at that time, thus the
Bootstrapyou have. You'd be surprised how good solution spring-shell is with spring-boot as there's been a years of maintenance in a framework itself.Also if you choose to migrate, you have a good path forward to keep dependencies up-to-date, get a change to be on a supported versions from both spring and jdk.
jvalkeal commentedon Jul 29, 2022
I think it's better to move this into discussion.