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


##########
solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc:
##########
@@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment 
to understand that the
 
 `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr 
-m 512m`
 
+`-e <name>` or `--example <name>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Start Solr with an example configuration.
+These examples are provided to help you get started faster with Solr 
generally, or just try a specific feature.
++
+The available options are:
+
+* `cloud`: SolrCloud example
+* `techproducts`: Comprehensive example illustrating many of Solr's core 
capabilities
+* `schemaless`: Schema-less example (schema is inferred from data during 
indexing)
+* `films`: Example of starting with _default configset and adding explicit 
fields dynamically
++
+See the section <<Running with Example Configurations>> below for more details 
on the example configurations.
++
+*Example*: `bin/solr start -e schemaless`
+
+`--no-prompt`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Don't prompt for input; accept all defaults when running examples that accept 
user input.
++
+For example, when using the "cloud" example, an interactive session guides you 
through several options for your SolrCloud cluster.
+If you want to accept all of the defaults, you can simply add the 
`--no-prompt` option to your request.
++
+*Example*: `bin/solr start -e cloud --no-prompt`
+
+`--prompts <values>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Don't prompt for input; provide defaults in comma delimited format when 
running examples that accept user input.
++
+For example, when using the "cloud" example, can start a three node cluster on 
specific ports:
++
+*Example*: `bin/solr start -e cloud --prompts 
3,9000,9001,9002,"mycollection",2,2,_defaults`

Review Comment:
   `--user-inputs` could work. `--prompt-inputs` could also be a candidate?    



##########
solr/bin/solr.cmd:
##########
@@ -399,6 +401,7 @@ IF "%1"=="-j" goto set_addl_jetty_config
 IF "%1"=="--jettyconfig" goto set_addl_jetty_config
 IF "%1"=="-y" goto set_noprompt
 IF "%1"=="--no-prompt" goto set_noprompt
+IF "%1"=="--prompt"s goto set_prompts

Review Comment:
   misplaced quote in "--prompts" breaks command



##########
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##########
@@ -73,6 +73,16 @@ public class RunExampleTool extends ToolBase {
               "Don't prompt for input; accept all defaults when running 
examples that accept user input.")
           .build();
 
+  private static final Option PROMPTS_OPTION =
+      Option.builder()
+          .longOpt("prompts")
+          .hasArg()
+          .argName("VALUES")
+          .desc(
+              "Provide comma-separated values for prompts. Same as --no-prompt 
but uses provided values instead of defaults. "
+                  + "Example: --prompts 
3,8983,8984,8985,\"gettingstarted\",2,2,_default")

Review Comment:
   Passing a formatted json in CLI could quickly get tricky with the quote 
escaping etc, especially on Windows. I like the properties file idea. Somewhat 
like we have for basic auth in solr.in.sh and solr.in.cmd with 
"SOLR_AUTHENTICATION_OPTS" 
(https://solr.apache.org/guide/solr/latest/deployment-guide/basic-authentication-plugin.html#using-the-solr-control-script-with-basic-auth).
 It can take the actual credentials as well as path to a file. 
   
   I am ok if the properties file enhancement comes as a second wave (one can 
hope!) and we could still use it against the same --prompts param.



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