cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject [1/2] git commit: Get Windows command-line flags in-line with linux
Date Wed, 10 Sep 2014 16:13:51 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 2cba3fc95 -> 685140267


Get Windows command-line flags in-line with linux

patch by Josh McKenzie; reviewed by Philip Thompson for CASSANDRA-7748


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/dbcc4eae
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/dbcc4eae
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/dbcc4eae

Branch: refs/heads/trunk
Commit: dbcc4eae6c974a925531b024e58f9c5878dc84a8
Parents: 9b9bf45
Author: Joshua McKenzie <josh.mckenzie@datastax.com>
Authored: Wed Sep 10 09:10:52 2014 -0700
Committer: Joshua McKenzie <josh.mckenzie@datastax.com>
Committed: Wed Sep 10 09:10:52 2014 -0700

----------------------------------------------------------------------
 bin/cassandra.ps1 | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/dbcc4eae/bin/cassandra.ps1
----------------------------------------------------------------------
diff --git a/bin/cassandra.ps1 b/bin/cassandra.ps1
index 91519b4..ea06f63 100644
--- a/bin/cassandra.ps1
+++ b/bin/cassandra.ps1
@@ -17,7 +17,8 @@ param (
     [switch]$install,
     [switch]$uninstall,
     [switch]$help,
-    [switch]$verbose,
+    [switch]$v,
+    [switch]$s,
     [switch]$f,
     [string]$p,
     [string]$H,
@@ -51,8 +52,9 @@ usage: cassandra.ps1 [-f] [-h] [-p pidfile] [-H dumpfile] [-D arg] [-E errorfile
     -H              change JVM HeapDumpPath
     -D              items to append to JVM_OPTS
     -E              change JVM ErrorFile
+    -v              Print cassandra version and exit
+    -s              Show detailed jvm environment information during launch
     -help           print this message
-    -verbose        Show detailed command-line parameters for cassandra run
 
     NOTE: installing cassandra as a service requires Commons Daemon Service Runner
         available at http://commons.apache.org/proper/commons-daemon/"
@@ -76,13 +78,18 @@ Function Main
     . "$env:CASSANDRA_HOME\bin\source-conf.ps1"
 
     $conf = Find-Conf
-    if ($verbose)
+    if ($s)
     {
         echo "Sourcing cassandra config file: $conf"
     }
     . $conf
 
     SetCassandraEnvironment
+    if ($v)
+    {
+        PrintVersion
+        exit
+    }
     $pidfile = "$env:CASSANDRA_HOME\$pidfile"
 
     $logdir = "$env:CASSANDRA_HOME/logs"
@@ -196,6 +203,20 @@ Function HandleInstallation
 }
 
 #-----------------------------------------------------------------------------
+Function PrintVersion()
+{
+    Write-Host "Cassandra Version: " -NoNewLine
+    $pinfo = New-Object System.Diagnostics.ProcessStartInfo
+    $pinfo.FileName = "$env:JAVA_BIN"
+    $pinfo.UseShellExecute = $false
+    $pinfo.Arguments = "-cp $env:CLASSPATH org.apache.cassandra.tools.GetVersion"
+    $p = New-Object System.Diagnostics.Process
+    $p.StartInfo = $pinfo
+    $p.Start() | Out-Null
+    $p.WaitForExit()
+}
+
+#-----------------------------------------------------------------------------
 Function RunCassandra([string]$foreground)
 {
     echo "Starting cassandra server"
@@ -211,7 +232,7 @@ $env:JAVA_BIN
 
     $proc = $null
 
-    if ($verbose)
+    if ($s)
     {
         echo "Running cassandra with: [$cmd $arg1 $arg2 $arg3 $arg4]"
     }


Mime
View raw message