1
0
forked from MTSR/mapserver
mapserver/params/params.go
NatureFreshMilk 11ebd96b9b debug flag
2019-01-18 14:23:33 +01:00

29 lines
535 B
Go

package params
import (
"flag"
)
type ParamsType struct {
Help bool
Version bool
Debug bool
Dumpconfig bool
}
func Parse() ParamsType {
params := ParamsType{}
flag.BoolVar(&(params.Help), "help", false, "Show help")
flag.BoolVar(&(params.Version), "version", false, "Show version")
flag.BoolVar(&(params.Dumpconfig), "dumpconfig", false, "dump mapserver.json and exit")
flag.BoolVar(&(params.Debug), "debug", false, "enable debug log")
flag.Parse()
return params
}
func PrintHelp() {
flag.PrintDefaults()
}