mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-13 04:46:40 -05:00
Always print version
This commit is contained in:
parent
9cf5c3edfb
commit
1675063dc6
25
core.go
25
core.go
@ -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
|
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user