Merge b817d138fc
into 2d10654be2
This commit is contained in:
commit
0246f3d801
@ -29,7 +29,7 @@ func init() {
|
|||||||
|
|
||||||
flag.Var(&baseCfg.route.ChainNodes, "F", "forward address, can make a forward chain")
|
flag.Var(&baseCfg.route.ChainNodes, "F", "forward address, can make a forward chain")
|
||||||
flag.Var(&baseCfg.route.ServeNodes, "L", "listen address, can listen on multiple ports")
|
flag.Var(&baseCfg.route.ServeNodes, "L", "listen address, can listen on multiple ports")
|
||||||
flag.StringVar(&configureFile, "C", "", "configure file")
|
flag.StringVar(&configureFile, "C", "gost.json", "configure file")
|
||||||
flag.BoolVar(&baseCfg.Debug, "D", false, "enable debug log")
|
flag.BoolVar(&baseCfg.Debug, "D", false, "enable debug log")
|
||||||
flag.BoolVar(&printVersion, "V", false, "print version")
|
flag.BoolVar(&printVersion, "V", false, "print version")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
@ -40,18 +40,22 @@ func init() {
|
|||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
if configureFile != "" {
|
_, err := os.Stat(configureFile);
|
||||||
|
if err == nil {
|
||||||
_, err := parseBaseConfig(configureFile)
|
_, err := parseBaseConfig(configureFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Log(err)
|
log.Log(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
if os.IsNotExist(err) {
|
||||||
if flag.NFlag() == 0 {
|
if flag.NFlag() == 0 {
|
||||||
flag.PrintDefaults()
|
flag.PrintDefaults()
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if os.Getenv("PROFILING") != "" {
|
if os.Getenv("PROFILING") != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user