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
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)
}

View File

@ -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
}