vise/go/dev/interactive.go
2023-04-09 15:58:35 +01:00

28 lines
570 B
Go

package main
import (
"context"
"flag"
"fmt"
"os"
"git.defalsify.org/festive/engine"
)
func main() {
var dir string
var root string
flag.StringVar(&dir, "d", ".", "resource dir to read from")
flag.StringVar(&root, "root", "root", "entry point symbol")
flag.Parse()
fmt.Fprintf(os.Stderr, "starting session at symbol '%s' using resource dir: %s\n", root, dir)
ctx := context.Background()
en := engine.NewDefaultEngine(dir)
err := engine.Loop(root, &en, ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "loop exited with error: %v", err)
os.Exit(1)
}
}