You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2026/06/11 07:58:55 UTC

(iotdb) branch fix_windows_cmd created (now 5a9c8f193cc)

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

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


      at 5a9c8f193cc Fix -pw without password may take incorrect args

This branch includes the following new commits:

     new 5a9c8f193cc Fix -pw without password may take incorrect args

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(iotdb) 01/01: Fix -pw without password may take incorrect args

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5a9c8f193cc812dd1404325498e2d11842c23ef0
Author: Tian Jiang <jt...@163.com>
AuthorDate: Thu Jun 11 15:51:15 2026 +0800

    Fix -pw without password may take incorrect args
---
 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%