From 3f83a695b601cb6089747c8df5a051be697a02f3 Mon Sep 17 00:00:00 2001 From: Taeyoung Son Date: Mon, 7 Oct 2013 16:21:02 +0900 Subject: [PATCH] [Title] Fixed bug in common.bat [Desc.] [Issue] Change-Id: I444aae797bc415390900f524d0e6a817a9d7dd91 Signed-off-by: Taeyoung Son --- org.tizen.cli/doc/install/bin_/common.bat | 162 +++++++++++++++++++++--------- 1 file changed, 115 insertions(+), 47 deletions(-) diff --git a/org.tizen.cli/doc/install/bin_/common.bat b/org.tizen.cli/doc/install/bin_/common.bat index b42318c..8c36153 100755 --- a/org.tizen.cli/doc/install/bin_/common.bat +++ b/org.tizen.cli/doc/install/bin_/common.bat @@ -1,47 +1,115 @@ -@echo off -set CLI_HOME=%1 -set CLI_NAME=%2 -set MAIN=%3 -set ARGS=%4 - -set OPT_LOGGING=-Dlog4j.configuration=log4j.xml -set OPT_PRG_NAME=-Dcli.name=%CLI_NAME% -set LIB_PATH=%CLI_HOME%\lib - -set classpath= -FOR /f "tokens=*" %%i IN ('dir %LIB_PATH% /B') DO ( call:CONCAT %LIB_PATH%\%%i ) - -set READ_ARG="n" - -FOR %%W IN ( %* ) DO ( call:parseArg %%W ) - -set OPT=%OPT_TRACE% %OPT_LOGGING% %OPT_PRG_NAME% -set EXEC=java -cp %CLI_HOME%\conf;%classpath% %OPT% %MAIN% %ARGS% - -IF NOT "" == "%OPT_TRACE%" ( echo Command :%EXEC% ) - -%EXEC% -goto:eof - -:parseArg - IF "y" == %READ_ARG% goto SET_LOGGING - -:SECOND_STEP - IF "%~1" == "--log" goto SET_READY - IF "%~1" == "-l" goto SET_READY -:END_STEP -goto:eof - -:SET_LOGGING - set OPT_LOGGING=-Dlog4j.configuration=log4j-%~1.xml - IF "%~1" == "trace" set OPT_TRACE=-Dlog4j.debug=true - set READ_ARG="n" - - goto SECOND_STEP - -:SET_READY - set READ_ARG="y" - goto END_STEP - -:CONCAT - set classpath=%classpath%%1; +@echo off +set CLI_HOME=%1 +SHIFT +set SCRIPT=%1 +SHIFT +set MAIN=%1 +SHIFT +set ARGS= +:LOOP +if "%1"=="" goto AFTER_LOOP +set ARGS=%ARGS% %1 +SHIFT +goto LOOP +:AFTER_LOOP + + +set OPT_LOGGING=-Dlog4j.configuration=log4j.xml +set OPT_PRG_NAME=-Dcli.name=%SCRIPT% +set LIB_PATH=%CLI_HOME%\lib + +set classpath= +FOR /f "tokens=*" %%i IN ('dir %LIB_PATH% /B') DO ( call:CONCAT %LIB_PATH%\%%i ) + +set READ_ARG="n" + +FOR %%W IN ( %* ) DO ( call:parseArg %%W ) + +set OPT=%OPT_TRACE% %OPT_LOGGING% %OPT_PRG_NAME% +set EXEC=java -cp %CLI_HOME%\conf;%classpath% %OPT% %MAIN% %ARGS% +@echo off +set CLI_HOME=%1 +SHIFT +set SCRIPT=%1 +SHIFT +set MAIN=%1 +SHIFT +set ARGS= +:LOOP +if "%1"=="" goto AFTER_LOOP +set ARGS=%ARGS% %1 +SHIFT +goto LOOP +:AFTER_LOOP + + +set OPT_LOGGING=-Dlog4j.configuration=log4j.xml +set OPT_PRG_NAME=-Dcli.name=%SCRIPT% +set LIB_PATH=%CLI_HOME%\lib + +set classpath= +FOR /f "tokens=*" %%i IN ('dir %LIB_PATH% /B') DO ( call:CONCAT %LIB_PATH%\%%i ) + +set READ_ARG="n" + +FOR %%W IN ( %* ) DO ( call:parseArg %%W ) + +set OPT=%OPT_TRACE% %OPT_LOGGING% %OPT_PRG_NAME% +set EXEC=java -cp %CLI_HOME%\conf;%classpath% %OPT% %MAIN% %ARGS% + +IF NOT "" == "%OPT_TRACE%" ( echo Command :%EXEC% ) + +%EXEC% +goto:eof + +:parseArg + IF "y" == %READ_ARG% goto SET_LOGGING + +:SECOND_STEP + IF "%~1" == "--log" goto SET_READY + IF "%~1" == "-l" goto SET_READY +:END_STEP +goto:eof + +:SET_LOGGING + set OPT_LOGGING=-Dlog4j.configuration=log4j-%~1.xml + IF "%~1" == "trace" set OPT_TRACE=-Dlog4j.debug=true + set READ_ARG="n" + + goto SECOND_STEP + +:SET_READY + set READ_ARG="y" + goto END_STEP + +:CONCAT + set classpath=%classpath%%1; + +IF NOT "" == "%OPT_TRACE%" ( echo Command :%EXEC% ) + +%EXEC% +goto:eof + +:parseArg + IF "y" == %READ_ARG% goto SET_LOGGING + +:SECOND_STEP + IF "%~1" == "--log" goto SET_READY + IF "%~1" == "-l" goto SET_READY +:END_STEP +goto:eof + +:SET_LOGGING + set OPT_LOGGING=-Dlog4j.configuration=log4j-%~1.xml + IF "%~1" == "trace" set OPT_TRACE=-Dlog4j.debug=true + set READ_ARG="n" + + goto SECOND_STEP + +:SET_READY + set READ_ARG="y" + goto END_STEP + +:CONCAT + set classpath=%classpath%%1; + -- 2.7.4