Use more reliable shift loop for processing args

This commit is contained in:
Miranda Kastemaa 2016-10-17 15:51:53 +03:00
parent a1dfe86698
commit c4aa9052b5
1 changed files with 16 additions and 11 deletions

View File

@ -52,20 +52,25 @@ rem We use the value of the JAVA_OPTS environment variable if defined, rather th
set _JAVA_OPTS=%JAVA_OPTS% set _JAVA_OPTS=%JAVA_OPTS%
if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS% if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS%
FOR %%a IN (%*) DO ( :args_loop
if "%%a" == "-jvm-debug" ( if "%~1" == "" goto args_end
set JVM_DEBUG=true
set /a JVM_DEBUG_PORT=5005 2>nul >nul if "%~1" == "-jvm-debug" (
) else if "!JVM_DEBUG!" == "true" ( set JVM_DEBUG=true
set /a JVM_DEBUG_PORT=%%a 2>nul >nul set /a JVM_DEBUG_PORT=5005 2>nul >nul
if not "%%a" == "!JVM_DEBUG_PORT!" ( ) else if "!JVM_DEBUG!" == "true" (
set SBT_ARGS=!SBT_ARGS! %%a set /a JVM_DEBUG_PORT=%1 2>nul >nul
) if not "%~1" == "!JVM_DEBUG_PORT!" (
) else ( set SBT_ARGS=!SBT_ARGS! %1
set SBT_ARGS=!SBT_ARGS! %%a
) )
) else (
set SBT_ARGS=!SBT_ARGS! %1
) )
shift
goto args_loop
:args_end
if defined JVM_DEBUG_PORT ( if defined JVM_DEBUG_PORT (
set _JAVA_OPTS=!_JAVA_OPTS! -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=!JVM_DEBUG_PORT! set _JAVA_OPTS=!_JAVA_OPTS! -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=!JVM_DEBUG_PORT!
) )