2023-12-29 09:24:06 -06:00
|
|
|
package gui
|
|
|
|
|
|
|
|
import (
|
|
|
|
arg "github.com/alexflint/go-arg"
|
2023-12-31 16:08:18 -06:00
|
|
|
|
2024-01-03 18:15:54 -06:00
|
|
|
"go.wit.com/log"
|
2023-12-29 09:24:06 -06:00
|
|
|
)
|
|
|
|
|
2024-01-03 18:54:08 -06:00
|
|
|
var INFO log.LogFlag
|
|
|
|
|
2024-01-03 18:15:54 -06:00
|
|
|
var GUI log.LogFlag
|
|
|
|
var NODE log.LogFlag
|
|
|
|
var PLUG log.LogFlag
|
2024-01-03 18:54:08 -06:00
|
|
|
var CHANGE log.LogFlag
|
2024-01-03 18:15:54 -06:00
|
|
|
|
2023-12-29 17:24:16 -06:00
|
|
|
var argGui ArgsGui
|
2023-12-29 09:24:06 -06:00
|
|
|
|
|
|
|
// This struct can be used with the go-arg package
|
2023-12-29 17:24:16 -06:00
|
|
|
type ArgsGui struct {
|
|
|
|
GuiPlugin string `arg:"--gui" help:"Use this gui toolkit [andlabs,gocui,nocui]"`
|
2023-12-29 09:24:06 -06:00
|
|
|
GuiVerbose bool `arg:"--gui-verbose" help:"enable all logging"`
|
|
|
|
}
|
|
|
|
|
2024-01-03 18:15:54 -06:00
|
|
|
// returns the toolkit
|
|
|
|
func ArgToolkit() string {
|
|
|
|
return argGui.GuiPlugin
|
|
|
|
}
|
|
|
|
|
2023-12-29 09:24:06 -06:00
|
|
|
func init() {
|
2023-12-29 17:24:16 -06:00
|
|
|
arg.Register(&argGui)
|
2023-12-31 16:08:18 -06:00
|
|
|
|
2024-01-03 18:15:54 -06:00
|
|
|
INFO.B = false
|
|
|
|
INFO.Name = "INFO"
|
|
|
|
INFO.Subsystem = "gui"
|
|
|
|
INFO.Desc = "Enable log.Info()"
|
|
|
|
INFO.Register()
|
|
|
|
|
|
|
|
GUI.B = false
|
|
|
|
GUI.Name = "GUI"
|
|
|
|
GUI.Subsystem = "gui"
|
|
|
|
GUI.Desc = "basic GUI debugging"
|
|
|
|
GUI.Register()
|
|
|
|
|
|
|
|
NODE.B = false
|
|
|
|
NODE.Name = "NODE"
|
|
|
|
NODE.Subsystem = "gui"
|
|
|
|
NODE.Desc = "basic NODE debugging"
|
|
|
|
NODE.Register()
|
|
|
|
|
|
|
|
PLUG.B = false
|
|
|
|
PLUG.Name = "PLUG"
|
|
|
|
PLUG.Subsystem = "gui"
|
|
|
|
PLUG.Desc = "basic PLUG debugging"
|
|
|
|
PLUG.Register()
|
|
|
|
|
2024-01-03 18:54:08 -06:00
|
|
|
CHANGE.B = false
|
|
|
|
CHANGE.Name = "CHANGE"
|
|
|
|
CHANGE.Subsystem = "gui"
|
|
|
|
CHANGE.Desc = "user changed something"
|
|
|
|
CHANGE.Register()
|
2023-12-29 09:24:06 -06:00
|
|
|
}
|