From 597f26b4dd9b8541cda888dc40541ed93c13441e Mon Sep 17 00:00:00 2001 From: Robert Janetzko Date: Thu, 14 Apr 2022 14:06:17 +0000 Subject: [PATCH] rename modules --- analyze/{main.go => analyze.go} | 16 ++++++++++++++++ analyze/go.sum | 2 -- backend/main.go | 10 ---------- 3 files changed, 16 insertions(+), 12 deletions(-) rename analyze/{main.go => analyze.go} (98%) diff --git a/analyze/main.go b/analyze/analyze.go similarity index 98% rename from analyze/main.go rename to analyze/analyze.go index 895fe88..830c9f8 100644 --- a/analyze/main.go +++ b/analyze/analyze.go @@ -3,6 +3,7 @@ package main import ( "encoding/json" "encoding/xml" + "flag" "fmt" "io" "io/ioutil" @@ -18,6 +19,21 @@ import ( "github.com/robertjanetzko/LegendsBrowser2/backend/util" ) +func main() { + a := flag.String("a", "", "analyze a file") + g := flag.Bool("g", false, "generate model") + flag.Parse() + + if len(*a) > 0 { + Analyze(*a) + } + + if *g { + fmt.Println("Generating") + Generate() + } +} + func Analyze(filex string) { fmt.Println("Search...", filex) files, err := filepath.Glob(filex + "/*.xml") diff --git a/analyze/go.sum b/analyze/go.sum index 52785b4..e69de29 100644 --- a/analyze/go.sum +++ b/analyze/go.sum @@ -1,2 +0,0 @@ -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= diff --git a/backend/main.go b/backend/main.go index 4800a22..09eb877 100644 --- a/backend/main.go +++ b/backend/main.go @@ -17,19 +17,9 @@ import ( var world *df.DfWorld func main() { - // a := flag.String("a", "", "analyze a file") - // g := flag.Bool("g", false, "generate model") f := flag.String("f", "", "open a file") flag.Parse() - // if len(*a) > 0 { - // analyze.Analyze(*a) - // } - // if *g { - // fmt.Println("Generating") - // analyze.Generate() - // } - if len(*f) > 0 { defer profile.Start(profile.MemProfile).Stop() go func() {