Always print version

This commit is contained in:
V2Ray 2015-10-13 14:30:37 +02:00
parent 9cf5c3edfb
commit 1675063dc6
2 changed files with 14 additions and 16 deletions

25
core.go
View File

@ -1,20 +1,19 @@
// Package core provides common definitions and functionalities of V2Ray. // Package core provides common definitions and functionalities of V2Ray.
package core package core
import (
"fmt"
)
var ( var (
version = "0.8" version = "0.8"
build = "Custom" build = "Custom"
codename = "Post Apocalypse"
intro = "A stable and unbreakable connection for everyone."
) )
const ( func PrintVersion() {
Codename = "Post Apocalypse" fmt.Printf("V2Ray %s (%s) %s", version, codename, build)
Intro = "A stable and unbreakable connection for everyone." fmt.Println()
) fmt.Println(intro)
func Version() string {
return version
}
func Build() string {
return build
} }

View File

@ -24,10 +24,9 @@ var (
func main() { func main() {
flag.Parse() flag.Parse()
core.PrintVersion()
if *version { if *version {
fmt.Printf("V2Ray %s (%s) %s", core.Version(), core.Codename, core.Build())
fmt.Println()
fmt.Println(core.Intro)
return return
} }