epugh commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2821580746
##########
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##########
@@ -530,10 +549,24 @@ protected void runCloudExample(CommandLine cli) throws
Exception {
echo("\nWelcome to the SolrCloud example!\n");
- Scanner readInput = prompt ? new Scanner(userInput,
StandardCharsets.UTF_8) : null;
+ Scanner readInput = null;
+ if (usingPromptInputs) {
+ // Create a scanner from the provided prompts
+ String promptsValue = cli.getOptionValue(PROMPT_INPUTS_OPTION);
+ InputStream promptsStream =
+ new
java.io.ByteArrayInputStream(promptsValue.getBytes(StandardCharsets.UTF_8));
+ readInput = new Scanner(promptsStream, StandardCharsets.UTF_8);
+ readInput.useDelimiter(",");
+ prompt = true; // Enable prompting code path, but reading from prompts
instead of user
+ } else if (prompt) {
+ readInput = new Scanner(userInput, StandardCharsets.UTF_8);
+ }
Review Comment:
done
--
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]