From 1cd5f295939e25e6af54bf69ae9f551f23c57f23 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 23 Jul 2020 16:45:34 +0100 Subject: progress on parsing variables - can do again datamap import and setup --- cmd/datamaps/main.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'cmd/datamaps') diff --git a/cmd/datamaps/main.go b/cmd/datamaps/main.go index 82a655b..f37f537 100644 --- a/cmd/datamaps/main.go +++ b/cmd/datamaps/main.go @@ -52,7 +52,26 @@ func setUp() (string, error) { func main() { - _ = datamaps.ParseOptions() + opts := datamaps.ParseOptions() + + switch opts.Command { + case "datamap": + data, err := datamaps.ReadDML(opts.DMPath) + if err != nil { + log.Fatal(err) + } + opts.DMData = data + + err = datamaps.DatamapToDB(opts) + if err != nil { + log.Fatal(err) + } + case "setup": + _, err := setUp() + if err != nil { + log.Fatal(err) + } + } // switch os.Args[1] { -- cgit v1.2.3