summaryrefslogtreecommitdiff
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
parent8a144eb5fd1ea8a799af51d93518b8080e6624f1 (diff)
try to add --no-guiv0.22.6
-rw-r--r--Makefile21
-rw-r--r--argv.go (renamed from args.go)3
-rw-r--r--main.go4
3 files changed, 8 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index f46e907..b37bb3f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,26 +1,12 @@
all:
- @GO111MODULE=off go build
@echo
@echo This is the core gui package 'go.wit.com/gui/gui'
@echo
@echo It creates a binary tree of widgets
@echo The widgets are things like Windows, Buttons, Labels, etc
@echo
- @go vet
-
-note-about-golang:
-ifeq ($(GO111MODULE),)
- @echo
- @echo If you are compiling this here, you probably want to set GO111MODULE
- @echo
- @echo Setting GO111MODULE means that the version you are compiling has plugins
- @echo that get compiled against this current running version of the code
- @echo Otherwise, the GO language plugins can complain about being compiled against
- @echo mis-matched versions
- @echo
- @echo export GO111MODULE=off
- @echo
-endif
+ @GO111MODULE=off go vet
+ @echo go vet: this go library package builds okay
goimports:
goimports -w *.go
@@ -38,6 +24,3 @@ update:
doc:
godoc -v
-
-submit-to-docs:
- GOPROXY=https://proxy.golang.org GO111MODULE=on go get go.wit.com/[email protected]
diff --git a/args.go b/argv.go
index 861d55b..7d687e8 100644
--- a/args.go
+++ b/argv.go
@@ -11,7 +11,8 @@ 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 {
- GuiPlugin string `arg:"--gui" help:"Use this gui toolkit [andlabs,gocui,nocui,nogui]"`
+ 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"`
}
diff --git a/main.go b/main.go
index 31f47f2..f04cc3c 100644
--- a/main.go
+++ b/main.go
@@ -263,6 +263,10 @@ func New() *Node {
// try to load andlabs, if that doesn't work, fall back to the console
func (n *Node) Default() *Node {
var err error
+ if argGui.NoGui {
+ log.Log(WARN, "--no-gui chill Winston. I don't need no gui")
+ return n
+ }
if argGui.GuiPlugin != "" {
log.Log(WARN, "New.Default() try toolkit =", argGui.GuiPlugin)
if n, err = n.LoadToolkit(argGui.GuiPlugin); err == nil {