This is an automated email from the ASF dual-hosted git repository.

malliaridis pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 44ea44d1fb0 Fix argument parsing for -D options with multiple values 
on Windows
44ea44d1fb0 is described below

commit 44ea44d1fb07019e8bcd56c7a341301566d64deb
Author: Christos Malliaridis <c.malliari...@gmail.com>
AuthorDate: Sat Dec 14 17:01:53 2024 +0100

    Fix argument parsing for -D options with multiple values on Windows
---
 solr/bin/solr.cmd | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index 1dca1a9e81c..b951036a404 100755
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -643,15 +643,37 @@ SHIFT
 goto parse_args
 
 :set_passthru
-set "PASSTHRU=%~1=%~2"
+set "PASSTHRU_KEY=%~1"
+set "PASSTHRU_VALUES="
+
+SHIFT
+:repeat_passthru
+set "arg=%~1"
+if "%arg%"=="" goto end_passthru
+set firstChar=%arg:~0,1%
+IF "%firstChar%"=="-" (
+  goto end_passthru
+)
+
+if defined PASSTHRU_VALUES (
+    set "PASSTHRU_VALUES=%PASSTHRU_VALUES%,%arg%"
+) else (
+    set "PASSTHRU_VALUES=%arg%"
+)
+SHIFT
+goto repeat_passthru
+
+:end_passthru
+set "PASSTHRU=%PASSTHRU_KEY%=%PASSTHRU_VALUES%"
+echo "Passing through %PASSTHRU%"
+
 IF NOT "%SOLR_OPTS%"=="" (
   set "SOLR_OPTS=%SOLR_OPTS% %PASSTHRU%"
 ) ELSE (
   set "SOLR_OPTS=%PASSTHRU%"
 )
 set "PASS_TO_RUN_EXAMPLE=%PASSTHRU% !PASS_TO_RUN_EXAMPLE!"
-SHIFT
-SHIFT
+
 goto parse_args
 
 :set_noprompt

Reply via email to