rahulgoswami commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2808616899
##########
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##########
@@ -1121,9 +1155,24 @@ protected String prompt(Scanner s, String prompt) {
protected String prompt(Scanner s, String prompt, String defaultValue) {
echo(prompt);
- String nextInput = s.nextLine();
+ String nextInput;
+ if (usingPrompts) {
+ // Reading from prompts option - use next() instead of nextLine()
+ nextInput = s.hasNext() ? s.next() : null;
+ // Echo the value being used from prompts
+ if (nextInput != null) {
+ echo(nextInput);
+ }
+ } else {
+ // Reading from user input - use nextLine()
Review Comment:
Suggest moving `echo(prompt);` from the first line of the method to over
here. It would be fair to expect the CLI output for --prompt-inputs to be
similar to --no-prompt, aka without lines asking for inputs, since we are
already providing it in one shot.
##########
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##########
@@ -1121,9 +1155,24 @@ protected String prompt(Scanner s, String prompt) {
protected String prompt(Scanner s, String prompt, String defaultValue) {
echo(prompt);
- String nextInput = s.nextLine();
+ String nextInput;
+ if (usingPrompts) {
+ // Reading from prompts option - use next() instead of nextLine()
+ nextInput = s.hasNext() ? s.next() : null;
+ // Echo the value being used from prompts
+ if (nextInput != null) {
+ echo(nextInput);
Review Comment:
Do we need to print here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]