Files
subcoding/grow/cli/main.go

36 lines
547 B
Go
Raw Normal View History

2021-11-20 18:51:19 -10:00
package main
import "flag"
import "log"
2021-11-20 19:32:44 -10:00
import "math/rand"
2021-11-20 18:51:19 -10:00
import "os"
2021-11-20 19:32:44 -10:00
import "time"
2021-11-20 18:51:19 -10:00
2021-11-20 19:38:31 -10:00
import "github.com/firestuff/subcoding/grow"
2021-11-20 18:51:19 -10:00
func main() {
defPath := flag.String("def-path", "", "path to definition YAML file")
flag.Parse()
if *defPath == "" {
log.Fatal("Please specify --def-path")
}
2021-11-20 19:32:44 -10:00
rand.Seed(time.Now().UnixNano())
2021-11-20 18:51:19 -10:00
defFile, err := os.Open(*defPath)
if err != nil {
log.Fatal(err)
}
2021-11-20 19:38:31 -10:00
def, err := grow.NewDefinition(defFile)
2021-11-20 18:51:19 -10:00
if err != nil {
log.Fatal(err)
}
2021-11-20 19:38:31 -10:00
_, err = def.Grow()
if err != nil {
log.Fatal(err)
}
2021-11-20 18:51:19 -10:00
}