forked from MTSR/mapserver
world config
This commit is contained in:
parent
e4ca34696e
commit
f388e56fe8
4
main.go
4
main.go
@ -6,4 +6,8 @@ import (
|
||||
|
||||
func main(){
|
||||
params.Parse()
|
||||
p := params.Params()
|
||||
if (p.Help){
|
||||
return
|
||||
}
|
||||
}
|
@ -2,11 +2,12 @@ package params
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ParamsType struct {
|
||||
worlddir string
|
||||
Worlddir string
|
||||
Port int
|
||||
Help bool
|
||||
}
|
||||
|
||||
var params ParamsType
|
||||
@ -17,7 +18,13 @@ func Params() ParamsType {
|
||||
|
||||
func Parse(){
|
||||
params := ParamsType{}
|
||||
flag.StringVar(&(params.worlddir), "worlddir", "./", "world directory")
|
||||
|
||||
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.Parse()
|
||||
fmt.Println("World dir is: ", params.worlddir)
|
||||
|
||||
if (params.Help) {
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
}
|
7
worldconfig/parse.go
Normal file
7
worldconfig/parse.go
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
type WorldConfig struct {
|
||||
}
|
||||
|
||||
func Parse(data []byte) WorldConfig {
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user