2019-01-04 10:41:01 +03:00
|
|
|
package params
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ParamsType struct {
|
2019-01-18 11:11:13 +03:00
|
|
|
Help bool
|
|
|
|
Version bool
|
|
|
|
Dumpconfig bool
|
2019-01-04 10:41:01 +03:00
|
|
|
}
|
|
|
|
|
2019-01-04 15:02:17 +03:00
|
|
|
func Parse() ParamsType {
|
2019-01-04 10:41:01 +03:00
|
|
|
params := ParamsType{}
|
2019-01-04 12:44:41 +03:00
|
|
|
|
|
|
|
flag.BoolVar(&(params.Help), "help", false, "Show help")
|
2019-01-07 10:56:02 +03:00
|
|
|
flag.BoolVar(&(params.Version), "version", false, "Show version")
|
2019-01-18 11:11:13 +03:00
|
|
|
flag.BoolVar(&(params.Dumpconfig), "dumpconfig", false, "dump mapserver.json and exit")
|
2019-01-04 10:41:01 +03:00
|
|
|
flag.Parse()
|
2019-01-04 12:44:41 +03:00
|
|
|
|
2019-01-04 15:02:17 +03:00
|
|
|
return params
|
2019-01-04 13:00:49 +03:00
|
|
|
}
|
2019-01-18 10:47:38 +03:00
|
|
|
|
|
|
|
func PrintHelp(){
|
|
|
|
flag.PrintDefaults()
|
|
|
|
}
|