mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-26 03:57:42 -05:00
Always print version
This commit is contained in:
parent
9cf5c3edfb
commit
1675063dc6
21
core.go
21
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"
|
||||
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)
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user