From e4ca34696ef3afa25d729b25a94f15dcea14872f Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Fri, 4 Jan 2019 08:41:01 +0100 Subject: [PATCH] params --- .gitignore | 1 + main.go | 9 +++++++++ params/params.go | 23 +++++++++++++++++++++++ util/worldconfig.go | 0 4 files changed, 33 insertions(+) create mode 100644 .gitignore create mode 100644 main.go create mode 100644 params/params.go create mode 100644 util/worldconfig.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..24c8b58 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +mapserver \ No newline at end of file diff --git a/main.go b/main.go new file mode 100644 index 0000000..0db9327 --- /dev/null +++ b/main.go @@ -0,0 +1,9 @@ +package main + +import ( + "mapserver/params" +) + +func main(){ + params.Parse() +} \ No newline at end of file diff --git a/params/params.go b/params/params.go new file mode 100644 index 0000000..be17f6d --- /dev/null +++ b/params/params.go @@ -0,0 +1,23 @@ +package params + +import ( + "flag" + "fmt" +) + +type ParamsType struct { + worlddir string +} + +var params ParamsType + +func Params() ParamsType { + return params +} + +func Parse(){ + params := ParamsType{} + flag.StringVar(&(params.worlddir), "worlddir", "./", "world directory") + flag.Parse() + fmt.Println("World dir is: ", params.worlddir) +} \ No newline at end of file diff --git a/util/worldconfig.go b/util/worldconfig.go new file mode 100644 index 0000000..e69de29