From c3d4c6bb51a3d7b89e0fcbb69230db423577ae17 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 22 Jul 2020 17:02:41 +0100 Subject: reconfigured opts --- cmd/dm/main.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'cmd/dm') diff --git a/cmd/dm/main.go b/cmd/dm/main.go index 9a93fa4..de79441 100644 --- a/cmd/dm/main.go +++ b/cmd/dm/main.go @@ -73,6 +73,15 @@ func main() { os.Exit(1) } + opts := reader.Opts{ + DBPath: "", + ImportPath: *importFlg, + Name: *nameFlg, + Overwrite: *overwriteFlg, + Initial: *initialFlg, + DMData: nil, + } + switch os.Args[1] { case "server": @@ -109,13 +118,14 @@ func main() { os.Exit(1) } // Here we actually read the data from the file - data, err := reader.ReadDML(*importFlg) + data, err := reader.ReadDML(opts.ImportPath) if err != nil { log.Fatal(err) } + opts.DMData = data - db_path := filepath.Join(config_path, db_name) - err = reader.DatamapToDB(db_path, data, *nameFlg, *importFlg) + opts.DBPath = filepath.Join(config_path, db_name) + err = reader.DatamapToDB(opts) if err != nil { log.Fatal(err) } -- cgit v1.2.3