mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 09:28:27 +00:00
Add a -v flag to output version information, closes #128
This commit is contained in:
parent
2a19160ad6
commit
2878ae7dd6
@ -126,11 +126,16 @@ launch_service()
|
||||
}
|
||||
|
||||
# Parse any command line options.
|
||||
args=`getopt fhp:bD:X: "$@"`
|
||||
args=`getopt vfhp:D:X: "$@"`
|
||||
eval set -- "$args"
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
-v)
|
||||
$JAVA $JAVA_OPTS $ES_JAVA_OPTS $es_parms -cp $CLASSPATH $props \
|
||||
org.elasticsearch.Version
|
||||
exit 0
|
||||
;;
|
||||
-p)
|
||||
pidfile="$2"
|
||||
shift 2
|
||||
@ -140,7 +145,7 @@ while true; do
|
||||
shift
|
||||
;;
|
||||
-h)
|
||||
echo "Usage: $0 [-d] [-h] [-p pidfile]"
|
||||
echo "Usage: $0 [-f] [-h] [-p pidfile]"
|
||||
exit 0
|
||||
;;
|
||||
-D)
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch;
|
||||
|
||||
import org.elasticsearch.monitor.jvm.JvmConfig;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
@ -72,4 +74,8 @@ public class Version {
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("ElasticSearch Version: " + number + " (" + date() + "), JVM: " + JvmConfig.jvmConfig().vmVersion());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user