From c50414479213dcfa9cfff2cad2a4c5db8c2eb21c Mon Sep 17 00:00:00 2001 From: V2Ray Date: Fri, 18 Sep 2015 11:59:36 +0200 Subject: [PATCH] Version flag --- core.go | 4 +++- release/server/main.go | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core.go b/core.go index 923435c2d..dc3883193 100644 --- a/core.go +++ b/core.go @@ -2,5 +2,7 @@ package core const ( - Version = "0.1" + Version = "0.1" + Codename = "Post Apocalypse" + Intro = "A stable and unbreakable connection for every one." ) diff --git a/release/server/main.go b/release/server/main.go index e14aec0da..e1e5bae1b 100644 --- a/release/server/main.go +++ b/release/server/main.go @@ -2,6 +2,7 @@ package main import ( "flag" + "fmt" "io/ioutil" "path/filepath" @@ -17,11 +18,18 @@ import ( var ( configFile = flag.String("config", "", "Config file for this Point server.") logLevel = flag.String("loglevel", "", "Level of log info to be printed to console, available value: debug, info, warning, error") + version = flag.Bool("version", false, "Show current version of V2Ray.") ) func main() { flag.Parse() + if *version { + fmt.Printf("V2Ray version %s (%s): %s", core.Version, core.Codename, core.Intro) + fmt.Println() + return + } + switch *logLevel { case "debug": log.SetLogLevel(log.DebugLevel)