mapserver/params/params.go
NatureFreshMilk 6943f10f59 app bootstrap
2019-01-18 08:47:38 +01:00

29 lines
507 B
Go

package params
import (
"flag"
)
type ParamsType struct {
Worlddir string
Port int
Help bool
Version bool
}
func Parse() ParamsType {
params := ParamsType{}
flag.StringVar(&(params.Worlddir), "worlddir", "./", "world directory")
flag.IntVar(&(params.Port), "port", 8080, "port to use")
flag.BoolVar(&(params.Help), "help", false, "Show help")
flag.BoolVar(&(params.Version), "version", false, "Show version")
flag.Parse()
return params
}
func PrintHelp(){
flag.PrintDefaults()
}