Author: eevans
Date: Wed Feb 17 00:32:36 2010
New Revision: 910787

URL: http://svn.apache.org/viewvc?rev=910787&view=rev
Log:
pass args onto main class from cassandra-cli.bat

Patch by Mark Wolfe; reviewed by eevans for CASSANDRA-797

Modified:
    incubator/cassandra/trunk/bin/cassandra-cli.bat

Modified: incubator/cassandra/trunk/bin/cassandra-cli.bat
URL: 
http://svn.apache.org/viewvc/incubator/cassandra/trunk/bin/cassandra-cli.bat?rev=910787&r1=910786&r2=910787&view=diff
==============================================================================
--- incubator/cassandra/trunk/bin/cassandra-cli.bat (original)
+++ incubator/cassandra/trunk/bin/cassandra-cli.bat Wed Feb 17 00:32:36 2010
@@ -14,19 +14,38 @@
 @REM  See the License for the specific language governing permissions and
 @REM  limitations under the License.
 
+
 @echo off
-SETLOCAL
+if "%OS%" == "Windows_NT" setlocal
+
+if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD%
+if NOT DEFINED JAVA_HOME goto err
 
-SET CASSANDRA_LIBS=%CASSANDRA_HOME%\lib
+REM Ensure that any user defined CLASSPATH variables are not used on startup
+set CLASSPATH=
 
-FOR %%a IN (%CASSANDRA_HOME%\lib\*.jar) DO  call :append %%~fa
-java -cp %CASSANDRA_LIBS% org.apache.cassandra.cli.CliMain
+REM For each jar in the CASSANDRA_HOME lib directory call append to build the 
CLASSPATH variable.
+for %%i in (%CASSANDRA_HOME%\lib\*.jar) do call :append %%~fi
+goto okClasspath
 
 :append
-SET CASSANDRA_LIBS=%CASSANDRA_LIBS%;%1%2
-goto :finally
+set CLASSPATH=%CLASSPATH%;%1%2
+goto :eof
 
+:okClasspath
+REM Include the build\classes directory so it works in development
+set CASSANDRA_CLASSPATH=%CLASSPATH%;%CASSANDRA_HOME%\build\classes
+goto runCli
+
+:runCli
+echo Starting Cassandra Client
+"%JAVA_HOME%\bin\java" -cp "%CASSANDRA_CLASSPATH%" 
org.apache.cassandra.cli.CliMain %*
+goto finally
+
+:err
+echo The JAVA_HOME environment variable must be set to run this program!
+pause
 
 :finally
 
-ENDLOCAL
+ENDLOCAL
\ No newline at end of file


Reply via email to