Skip to content

Commit 0e87157

Browse files
committed
support in bin/solr scirpts, reorg the param details
1 parent 04ca619 commit 0e87157

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

solr/bin/solr

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,6 @@ function print_usage() {
407407
echo " --data-home <dir> Sets the solr.data.home system property, where Solr will store index data in <instance_dir>/data subdirectories."
408408
echo " If not set, Solr uses solr.solr.home for config and data."
409409
echo ""
410-
echo " -e/--example <name> Name of the example to run; available examples:"
411-
echo " cloud: SolrCloud example"
412-
echo " techproducts: Comprehensive example illustrating many of Solr's core capabilities"
413-
echo " schemaless: Schema-less example (schema is inferred from data during indexing)"
414-
echo " films: Example of starting with _default configset and adding explicit fields dynamically"
415-
echo ""
416410
echo " --jvm-opts <jvmParams> Additional parameters to pass to the JVM when starting Solr, such as to setup"
417411
echo " Java debug options. For example, to enable a Java debugger to attach to the Solr JVM"
418412
echo " you could pass: --jvm-opts \"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983\""
@@ -423,7 +417,15 @@ function print_usage() {
423417
echo " you could pass: -j \"--include-jetty-dir=/etc/jetty/custom/server/\""
424418
echo " In most cases, you should wrap the additional parameters in double quotes."
425419
echo ""
426-
echo " -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input"
420+
echo " -e/--example <name> Name of the example to run; available examples:"
421+
echo " cloud: SolrCloud example"
422+
echo " techproducts: Comprehensive example illustrating many of Solr's core capabilities"
423+
echo " schemaless: Schema-less example (schema is inferred from data during indexing)"
424+
echo " films: Example of starting with _default configset and adding explicit fields dynamically"
425+
echo ""
426+
echo " -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input."
427+
echo ""
428+
echo " --prompt <values> Don't prompt for input; comma delimited list of inputs read when running examples that accept user input."
427429
echo ""
428430
echo " --force If attempting to start Solr as the root user, the script will exit with a warning that running Solr as \"root\" can cause problems."
429431
echo " It is possible to override this warning with the '--force' parameter."

solr/bin/solr.cmd

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,6 @@ goto err
325325
@echo --data-home dir Sets the solr.data.home system property, where Solr will store index data in ^<instance_dir^>/data subdirectories.
326326
@echo If not set, Solr uses solr.solr.home for both config and data.
327327
@echo.
328-
@echo -e/--example name Name of the example to run; available examples:
329-
@echo cloud: SolrCloud example
330-
@echo techproducts: Comprehensive example illustrating many of Solr's core capabilities
331-
@echo schemaless: Schema-less example (schema is inferred from data during indexing)
332-
@echo films: Example of starting with _default configset and defining explicit fields dynamically
333-
@echo.
334328
@echo --jvm-opts opts Additional parameters to pass to the JVM when starting Solr, such as to setup
335329
@echo Java debug options. For example, to enable a Java debugger to attach to the Solr JVM
336330
@echo you could pass: --jvm-opts "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983"
@@ -341,8 +335,16 @@ goto err
341335
@echo you could pass: -j "--include-jetty-dir=/etc/jetty/custom/server/"
342336
@echo In most cases, you should wrap the additional parameters in double quotes.
343337
@echo.
338+
@echo -e/--example name Name of the example to run; available examples:
339+
@echo cloud: SolrCloud example
340+
@echo techproducts: Comprehensive example illustrating many of Solr's core capabilities
341+
@echo schemaless: Schema-less example (schema is inferred from data during indexing)
342+
@echo films: Example of starting with _default configset and defining explicit fields dynamically
343+
@echo.
344344
@echo -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input
345345
@echo.
346+
@echo --prompt <values> Don't prompt for input; comma delimited list of inputs read when running examples that accept user input."
347+
@echo.
346348
@echo --verbose and -q/--quiet Verbose or quiet logging. Sets default log level to DEBUG or WARN instead of INFO
347349
@echo.
348350
goto done
@@ -399,6 +401,7 @@ IF "%1"=="-j" goto set_addl_jetty_config
399401
IF "%1"=="--jettyconfig" goto set_addl_jetty_config
400402
IF "%1"=="-y" goto set_noprompt
401403
IF "%1"=="--no-prompt" goto set_noprompt
404+
IF "%1"=="--prompt" goto set_prompt
402405

403406
REM Skip stop arg parsing if not stop command
404407
IF NOT "%SCRIPT_CMD%"=="stop" goto parse_general_args
@@ -695,6 +698,12 @@ set "PASS_TO_RUN_EXAMPLE=--no-prompt !PASS_TO_RUN_EXAMPLE!"
695698
SHIFT
696699
goto parse_args
697700

701+
:set_prompt
702+
set "PASS_TO_RUN_EXAMPLE=--prompt %~2 !PASS_TO_RUN_EXAMPLE!"
703+
704+
SHIFT
705+
goto parse_args
706+
698707
REM Handle invalid arguments passed to special commands (start, stop, restart)
699708
:invalid_cmd_line
700709
@echo.

0 commit comments

Comments
 (0)