feat: support multiple -C config files
Change -C flag from string to stringList, allowing: gost -C base.yml -C services.yml -C auth.yml Closes go-gost/gost#150
This commit is contained in:
+2
-2
@@ -28,7 +28,7 @@ func (l *stringList) Set(value string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
cfgFile string
|
cfgFiles stringList
|
||||||
outputFormat string
|
outputFormat string
|
||||||
services stringList
|
services stringList
|
||||||
nodes stringList
|
nodes stringList
|
||||||
@@ -87,7 +87,7 @@ func init() {
|
|||||||
|
|
||||||
flag.Var(&services, "L", "service list")
|
flag.Var(&services, "L", "service list")
|
||||||
flag.Var(&nodes, "F", "chain node list")
|
flag.Var(&nodes, "F", "chain node list")
|
||||||
flag.StringVar(&cfgFile, "C", "", "configuration file")
|
flag.Var(&cfgFiles, "C", "configuration file(s)")
|
||||||
flag.BoolVar(&printVersion, "V", false, "print version")
|
flag.BoolVar(&printVersion, "V", false, "print version")
|
||||||
flag.StringVar(&outputFormat, "O", "", "output format, one of yaml|json format")
|
flag.StringVar(&outputFormat, "O", "", "output format, one of yaml|json format")
|
||||||
flag.BoolVar(&debug, "D", false, "debug mode")
|
flag.BoolVar(&debug, "D", false, "debug mode")
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ type program struct {
|
|||||||
|
|
||||||
func (p *program) Init(env svc.Environment) error {
|
func (p *program) Init(env svc.Environment) error {
|
||||||
parser.Init(parser.Args{
|
parser.Init(parser.Args{
|
||||||
CfgFile: cfgFile,
|
CfgFiles: cfgFiles,
|
||||||
Services: services,
|
Services: services,
|
||||||
Nodes: nodes,
|
Nodes: nodes,
|
||||||
Debug: debug,
|
Debug: debug,
|
||||||
|
|||||||
Reference in New Issue
Block a user