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

jt2594838 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new dbc4d4a27b6 Fix -pw without password may take incorrect args (#17914)
dbc4d4a27b6 is described below

commit dbc4d4a27b660399080e6b550eae3701ba5e1edd
Author: Jiang Tian <[email protected]>
AuthorDate: Thu Jun 11 17:17:24 2026 +0800

    Fix -pw without password may take incorrect args (#17914)
---
 scripts/sbin/windows/start-cli.bat | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/scripts/sbin/windows/start-cli.bat 
b/scripts/sbin/windows/start-cli.bat
index d3d85632533..8849e3ca431 100644
--- a/scripts/sbin/windows/start-cli.bat
+++ b/scripts/sbin/windows/start-cli.bat
@@ -60,9 +60,13 @@ if /I "%~1"=="-u" (
     goto parse_args
 )
 if /I "%~1"=="-pw" (
+    call :is_known_option "%~2"
     if "%~2"=="" (
         set "passwd_param=-pw"
         shift
+    ) else if "!IS_KNOWN_OPTION!"=="true" (
+        set "passwd_param=-pw"
+        shift
     ) else (
         set "passwd_param=-pw %~2"
         shift
@@ -93,6 +97,23 @@ set "PARAMETERS=%PARAMETERS% %~1"
 shift
 goto parse_args
 
+:is_known_option
+set "IS_KNOWN_OPTION=false"
+if /I "%~1"=="-h" set "IS_KNOWN_OPTION=true"
+if /I "%~1"=="-p" set "IS_KNOWN_OPTION=true"
+if /I "%~1"=="-u" set "IS_KNOWN_OPTION=true"
+if /I "%~1"=="-pw" set "IS_KNOWN_OPTION=true"
+if /I "%~1"=="-e" set "IS_KNOWN_OPTION=true"
+if /I "%~1"=="-help" set "IS_KNOWN_OPTION=true"
+if /I "%~1"=="-sql_dialect" set "IS_KNOWN_OPTION=true"
+if /I "%~1"=="-disableISO8601" set "IS_KNOWN_OPTION=true"
+if /I "%~1"=="-c" set "IS_KNOWN_OPTION=true"
+if /I "%~1"=="-timeout" set "IS_KNOWN_OPTION=true"
+if /I "%~1"=="-usessl" set "IS_KNOWN_OPTION=true"
+if /I "%~1"=="-ts" set "IS_KNOWN_OPTION=true"
+if /I "%~1"=="-tpw" set "IS_KNOWN_OPTION=true"
+exit /b 0
+
 :after_parse
 REM Combine all parameters
 set "PARAMETERS=%host_param% %port_param% %user_param% %passwd_param% 
%sql_dialect_param% %PARAMETERS%"
@@ -139,4 +160,4 @@ REM Run CLI
 REM -------------------------------
 endlocal
 
-exit /b %ERRORLEVEL%
\ No newline at end of file
+exit /b %ERRORLEVEL%

Reply via email to