forked from urdt/ussd
add engineDebug and stateDebug flags
This commit is contained in:
parent
8a03b05c90
commit
b8852e1ab3
12
cmd/main.go
12
cmd/main.go
@ -23,10 +23,12 @@ func main() {
|
|||||||
var dbDir string
|
var dbDir string
|
||||||
var size uint
|
var size uint
|
||||||
var sessionId string
|
var sessionId string
|
||||||
var debug bool
|
var engineDebug bool
|
||||||
|
var stateDebug bool
|
||||||
flag.StringVar(&sessionId, "session-id", "075xx2123", "session id")
|
flag.StringVar(&sessionId, "session-id", "075xx2123", "session id")
|
||||||
flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from")
|
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.UintVar(&size, "s", 160, "max size of output")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
@ -43,6 +45,10 @@ func main() {
|
|||||||
FlagCount: uint32(16),
|
FlagCount: uint32(16),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if stateDebug {
|
||||||
|
cfg.StateDebug = true
|
||||||
|
}
|
||||||
|
|
||||||
resourceDir := scriptDir
|
resourceDir := scriptDir
|
||||||
menuStorageService := storage.NewMenuStorageService(dbDir, resourceDir)
|
menuStorageService := storage.NewMenuStorageService(dbDir, resourceDir)
|
||||||
|
|
||||||
@ -93,7 +99,7 @@ func main() {
|
|||||||
|
|
||||||
en := lhs.GetEngine()
|
en := lhs.GetEngine()
|
||||||
en = en.WithFirst(hl.Init)
|
en = en.WithFirst(hl.Init)
|
||||||
if debug {
|
if engineDebug {
|
||||||
en = en.WithDebug(nil)
|
en = en.WithDebug(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user