dorfylegends/analyze/analyze.go
2022-04-18 15:26:14 +00:00

44 lines
670 B
Go

package main
import (
"flag"
"log"
"github.com/robertjanetzko/LegendsBrowser2/analyze/df"
)
func main() {
a := flag.String("a", "", "analyze a file")
g := flag.Bool("g", false, "generate model")
e := flag.Bool("e", false, "regenerate events")
flag.Parse()
if len(*a) > 0 {
df.AnalyzeStructure(*a)
}
if *g {
a, err := df.LoadAnalyzeData()
if err != nil {
log.Fatal(err)
}
df.ListEnumCandidates(a)
m, err := df.CreateMetadata(a)
if err != nil {
log.Fatal(err)
}
if err := df.GenerateBackendCode(m); err != nil {
log.Fatal(err)
}
if *e {
if err := df.GenerateEventsCode(m); err != nil {
log.Fatal(err)
}
}
}
}