Author: eevans Date: Mon May 23 20:38:04 2011 New Revision: 1126728 URL: http://svn.apache.org/viewvc?rev=1126728&view=rev Log: print version string
Patch by eevans; reviewed by jbellis for CASSANDRA-2689 Added: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/GetVersion.java Modified: cassandra/branches/cassandra-0.8/bin/cassandra Modified: cassandra/branches/cassandra-0.8/bin/cassandra URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/bin/cassandra?rev=1126728&r1=1126727&r2=1126728&view=diff ============================================================================== --- cassandra/branches/cassandra-0.8/bin/cassandra (original) +++ cassandra/branches/cassandra-0.8/bin/cassandra Mon May 23 20:38:04 2011 @@ -19,6 +19,7 @@ # OPTIONS: # -f: start in foreground # -p <filename>: log the pid to a file (useful to kill it later) +# -v: print version string and exit # CONTROLLING STARTUP: # @@ -129,7 +130,7 @@ launch_service() } # Parse any command line options. -args=`getopt fhp:bD: "$@"` +args=`getopt vfhp:bD: "$@"` eval set -- "$args" classname="org.apache.cassandra.thrift.CassandraDaemon" @@ -148,6 +149,10 @@ while true; do echo "Usage: $0 [-f] [-h] [-p pidfile]" exit 0 ;; + -v) + $JAVA -cp $CLASSPATH org.apache.cassandra.tools.GetVersion + exit 0 + ;; -D) properties="$properties -D$2" shift 2 Added: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/GetVersion.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/GetVersion.java?rev=1126728&view=auto ============================================================================== --- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/GetVersion.java (added) +++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/GetVersion.java Mon May 23 20:38:04 2011 @@ -0,0 +1,26 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.tools; + +import static org.apache.cassandra.utils.FBUtilities.getReleaseVersionString; + +public class GetVersion { + public static void main(String[] args) { + System.out.println(getReleaseVersionString()); + } +}