From b8852e1ab34fe6316bf67db8882711d29fa43f45 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Tue, 24 Sep 2024 14:10:10 +0300 Subject: [PATCH] add engineDebug and stateDebug flags --- cmd/main.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index bd3d634..036e6cb 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -23,10 +23,12 @@ func main() { var dbDir string var size uint var sessionId string - var debug bool + var engineDebug bool + var stateDebug bool flag.StringVar(&sessionId, "session-id", "075xx2123", "session id") flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from") - flag.BoolVar(&debug, "d", false, "use engine debug output") + flag.BoolVar(&engineDebug, "engine-debug", false, "use engine debug output") + flag.BoolVar(&stateDebug, "state-debug", false, "use engine debug output") flag.UintVar(&size, "s", 160, "max size of output") flag.Parse() @@ -43,6 +45,10 @@ func main() { FlagCount: uint32(16), } + if stateDebug { + cfg.StateDebug = true + } + resourceDir := scriptDir menuStorageService := storage.NewMenuStorageService(dbDir, resourceDir) @@ -93,7 +99,7 @@ func main() { en := lhs.GetEngine() en = en.WithFirst(hl.Init) - if debug { + if engineDebug { en = en.WithDebug(nil) }