From 1675063dc6007496a8cf5051b1ed8a0b832f0f3d Mon Sep 17 00:00:00 2001 From: V2Ray Date: Tue, 13 Oct 2015 14:30:37 +0200 Subject: [PATCH] Always print version --- core.go | 25 ++++++++++++------------- release/server/main.go | 5 ++--- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/core.go b/core.go index 9d7db7cfb..d681ec801 100644 --- a/core.go +++ b/core.go @@ -1,20 +1,19 @@ // Package core provides common definitions and functionalities of V2Ray. package core +import ( + "fmt" +) + var ( - version = "0.8" - build = "Custom" + version = "0.8" + build = "Custom" + codename = "Post Apocalypse" + intro = "A stable and unbreakable connection for everyone." ) -const ( - Codename = "Post Apocalypse" - Intro = "A stable and unbreakable connection for everyone." -) - -func Version() string { - return version -} - -func Build() string { - return build +func PrintVersion() { + fmt.Printf("V2Ray %s (%s) %s", version, codename, build) + fmt.Println() + fmt.Println(intro) } diff --git a/release/server/main.go b/release/server/main.go index 6a7d11f48..e202eb51a 100644 --- a/release/server/main.go +++ b/release/server/main.go @@ -24,10 +24,9 @@ var ( func main() { flag.Parse() + core.PrintVersion() + if *version { - fmt.Printf("V2Ray %s (%s) %s", core.Version(), core.Codename, core.Build()) - fmt.Println() - fmt.Println(core.Intro) return }