./mapserver -createconfig

This commit is contained in:
NatureFreshMilk 2019-02-14 14:51:20 +01:00
parent ca58abe930
commit 419844e4ec
2 changed files with 10 additions and 3 deletions

View File

@ -52,6 +52,11 @@ func main() {
panic(err)
}
//exit after creating the config
if p.CreateConfig {
return
}
//setup app context
ctx := app.Setup(p, cfg)

View File

@ -5,9 +5,10 @@ import (
)
type ParamsType struct {
Help bool
Version bool
Debug bool
Help bool
Version bool
Debug bool
CreateConfig bool
}
func Parse() ParamsType {
@ -16,6 +17,7 @@ func Parse() ParamsType {
flag.BoolVar(&(params.Help), "help", false, "Show help")
flag.BoolVar(&(params.Version), "version", false, "Show version")
flag.BoolVar(&(params.Debug), "debug", false, "enable debug log")
flag.BoolVar(&(params.CreateConfig), "createconfig", false, "creates a config and exits")
flag.Parse()
return params