mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-01 23:16:23 -05:00
Version flag
This commit is contained in:
parent
a2f32f46dd
commit
c504144792
4
core.go
4
core.go
@ -2,5 +2,7 @@
|
|||||||
package core
|
package core
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version = "0.1"
|
Version = "0.1"
|
||||||
|
Codename = "Post Apocalypse"
|
||||||
|
Intro = "A stable and unbreakable connection for every one."
|
||||||
)
|
)
|
||||||
|
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
@ -17,11 +18,18 @@ import (
|
|||||||
var (
|
var (
|
||||||
configFile = flag.String("config", "", "Config file for this Point server.")
|
configFile = flag.String("config", "", "Config file for this Point server.")
|
||||||
logLevel = flag.String("loglevel", "", "Level of log info to be printed to console, available value: debug, info, warning, error")
|
logLevel = flag.String("loglevel", "", "Level of log info to be printed to console, available value: debug, info, warning, error")
|
||||||
|
version = flag.Bool("version", false, "Show current version of V2Ray.")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if *version {
|
||||||
|
fmt.Printf("V2Ray version %s (%s): %s", core.Version, core.Codename, core.Intro)
|
||||||
|
fmt.Println()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
switch *logLevel {
|
switch *logLevel {
|
||||||
case "debug":
|
case "debug":
|
||||||
log.SetLogLevel(log.DebugLevel)
|
log.SetLogLevel(log.DebugLevel)
|
||||||
|
Loading…
Reference in New Issue
Block a user