summaryrefslogtreecommitdiff
path: root/args.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-12-29 17:24:16 -0600
committerJeff Carr <[email protected]>2023-12-29 17:24:16 -0600
commitced398383ee30b7fab4ff9e71cfa9d0ad96705b5 (patch)
treeb4bb9a1ccb545fc3d40c535bcd91c092645d739e /args.go
parent4b0077cce106d638944ecd8a6d49ee23fae79dc4 (diff)
using args.Register()
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'args.go')
-rw-r--r--args.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/args.go b/args.go
index 886880e..cc973b1 100644
--- a/args.go
+++ b/args.go
@@ -4,19 +4,25 @@ import (
arg "github.com/alexflint/go-arg"
)
-var guiArg GuiArgs
+var argGui ArgsGui
// This struct can be used with the go-arg package
-type GuiArgs struct {
- Gui string `arg:"--gui" help:"Use this gui toolkit [andlabs,gocui,nocui]"`
+type ArgsGui struct {
GuiDebug bool `arg:"--gui-debug" help:"open the GUI debugger"`
+ GuiPlugin string `arg:"--gui" help:"Use this gui toolkit [andlabs,gocui,nocui]"`
GuiVerbose bool `arg:"--gui-verbose" help:"enable all logging"`
}
func init() {
- arg.Register(&guiArg)
+ arg.Register(&argGui)
}
-func GetArg(a string) bool {
- return guiArg.GuiDebug
+// returns the toolkit
+func ArgToolkit() string {
+ return argGui.GuiPlugin
+}
+
+// returns true if --gui-debug was passed from the command line
+func ArgDebug() bool {
+ return argGui.GuiDebug
}