epugh commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2816471317


##########
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:
   I tried with and without and it looks much better with!  Plus you can debug 
it.  I was hoping that https://clig.dev/#interactivity would give some specific 
advice on formatting, but it didn't hold any wisdom...



-- 
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]

Reply via email to