summaryrefslogtreecommitdiff
path: root/argv.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-15 20:04:22 -0600
committerJeff Carr <[email protected]>2024-11-15 20:04:22 -0600
commitfd65e8f02e59f115c33fe73475742693027eebbd (patch)
treea7ddfc89b33322648948985e015fbbf1a0663a37 /argv.go
parent8a144eb5fd1ea8a799af51d93518b8080e6624f1 (diff)
try to add --no-guiv0.22.6
Diffstat (limited to 'argv.go')
-rw-r--r--argv.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/argv.go b/argv.go
new file mode 100644
index 0000000..7d687e8
--- /dev/null
+++ b/argv.go
@@ -0,0 +1,33 @@
+package gui
+
+import (
+ "go.wit.com/dev/alexflint/arg"
+)
+
+var argGui ArgsGui
+
+/*
+This struct can be used with the go-arg package. These
+are the generic default command line arguments for the 'GUI' package
+*/
+type ArgsGui struct {
+ NoGui bool `arg:"--no-gui" help:"ignore all these gui problems"`
+ GuiPlugin string `arg:"--gui" help:"Use this gui toolkit [andlabs,gocui,nocui,stdin]"`
+ GuiVerbose bool `arg:"--gui-verbose" help:"enable all logging"`
+}
+
+/*
+used for command line options.
+This allows you to control the toolkit settings from the command line
+
+ --debugger # opens the debugger
+ --gui andlabs # loads the GTK toolkit on linux or Cocoa on mac
+ --gui gocui # runs your program in the terminal in ncurses-like mode
+*/
+func ArgToolkit() string {
+ return argGui.GuiPlugin
+}
+
+func init() {
+ arg.Register(&argGui)
+}