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.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(&printVersion, "V", false, "print version")
|
||||
flag.Parse()
|
||||
@ -40,17 +40,21 @@ func init() {
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if configureFile != "" {
|
||||
_, err := os.Stat(configureFile);
|
||||
if err == nil {
|
||||
_, err := parseBaseConfig(configureFile)
|
||||
if err != nil {
|
||||
log.Log(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if os.IsNotExist(err) {
|
||||
if flag.NFlag() == 0 {
|
||||
flag.PrintDefaults()
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
Loading…
Reference in New Issue
Block a user