vise/dev/interactive/main.go

30 lines
660 B
Go
Raw Normal View History

package main
import (
"context"
"flag"
"fmt"
"os"
2023-04-14 10:59:37 +02:00
"git.defalsify.org/vise/engine"
)
func main() {
var dir string
var root string
var size uint
flag.StringVar(&dir, "d", ".", "resource dir to read from")
flag.UintVar(&size, "s", 0, "max size of output")
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.NewSizedEngine(dir, uint32(size))
2023-04-13 01:38:33 +02:00
err := engine.Loop(&en, os.Stdin, os.Stdout, ctx)
if err != nil {
2023-04-09 16:58:35 +02:00
fmt.Fprintf(os.Stderr, "loop exited with error: %v", err)
os.Exit(1)
}
}