Rehabilitate generic interactive tool

This commit is contained in:
lash 2023-04-16 13:41:41 +01:00
parent 1e80d37b73
commit 100f7f3b48
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746
1 changed files with 6 additions and 1 deletions

View File

@ -23,7 +23,12 @@ func main() {
ctx := context.Background()
en := engine.NewSizedEngine(dir, uint32(size))
err := engine.Loop(&en, os.Stdin, os.Stdout, ctx)
err := en.Init(ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "engine init exited with error: %v\n", err)
os.Exit(1)
}
err = engine.Loop(&en, os.Stdin, os.Stdout, ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "loop exited with error: %v\n", err)
os.Exit(1)