Fix dev commands directory structure

This commit is contained in:
lash
2023-04-12 18:20:45 +01:00
parent df9b30287c
commit 15c64a46e6
4 changed files with 4 additions and 2 deletions

29
dev/interactive/main.go Normal file
View File

@@ -0,0 +1,29 @@
package main
import (
"context"
"flag"
"fmt"
"os"
"git.defalsify.org/festive/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))
err := engine.Loop(&en, root, ctx, os.Stdin, os.Stdout)
if err != nil {
fmt.Fprintf(os.Stderr, "loop exited with error: %v", err)
os.Exit(1)
}
}