This commit is contained in:
Thomas Rudin 2019-01-04 11:00:49 +01:00
parent 4c69837401
commit 013985f76f
4 changed files with 11 additions and 10 deletions

View File

@ -4,10 +4,10 @@ import (
"mapserver/params"
)
func main(){
func main() {
params.Parse()
p := params.Params()
if (p.Help){
if p.Help {
return
}
}
}

View File

@ -6,8 +6,8 @@ import (
type ParamsType struct {
Worlddir string
Port int
Help bool
Port int
Help bool
}
var params ParamsType
@ -16,7 +16,7 @@ func Params() ParamsType {
return params
}
func Parse(){
func Parse() {
params := ParamsType{}
flag.StringVar(&(params.Worlddir), "worlddir", "./", "world directory")
@ -24,7 +24,7 @@ func Parse(){
flag.BoolVar(&(params.Help), "help", false, "Show help")
flag.Parse()
if (params.Help) {
if params.Help {
flag.PrintDefaults()
}
}
}

View File

View File

@ -1,7 +1,8 @@
package workdconfig
type WorldConfig struct {
}
func Parse(data []byte) WorldConfig {
}
}