chore: fixed typo and add some help info

This commit is contained in:
nadoo committed 2022-05-03 18:19:33 +08:00
1 parent 401efd621a
commit 846ca0b699
9 files changed
+80 -45

No files matched your search

+6 -4
View File
@@ -92,8 +92,7 @@ check=disable: disable health check`)
flag.StringSliceUniqVar(&conf.Services, "service", nil, "run specified services, format: SERVICE_NAME[,SERVICE_CONFIG]")
flag.Usage = usage
err := flag.Parse()
if err != nil {
if err := flag.Parse(); err != nil {
// flag.Usage()
fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
os.Exit(-1)
@@ -128,6 +127,11 @@ check=disable: disable health check`)
proxy.UDPBufSize = conf.UDPBufSize
}
loadRules(conf)
return conf
}
func loadRules(conf *Config) {
// rulefiles
for _, ruleFile := range conf.RuleFiles {
if !path.IsAbs(ruleFile) {
@@ -156,8 +160,6 @@ check=disable: disable health check`)
conf.rules = append(conf.rules, rule)
}
}
return conf
}
func usage() {