aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-07-22 17:02:41 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-07-22 17:02:41 +0100
commitc3d4c6bb51a3d7b89e0fcbb69230db423577ae17 (patch)
tree4ee56ca481c865634cf810db3fa0ec0eb78187d0 /cmd
parentd2d94cfb6e7c676ad9f709641b86417c17093657 (diff)
reconfigured opts
Diffstat (limited to '')
-rw-r--r--cmd/dm/main.go16
1 files changed, 13 insertions, 3 deletions
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)
}