summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go30
1 files changed, 17 insertions, 13 deletions
diff --git a/main.go b/main.go
index 1819e1b..4c507bf 100644
--- a/main.go
+++ b/main.go
@@ -18,7 +18,7 @@ import (
"github.com/google/uuid"
"go.wit.com/dev/alexflint/arg"
- "go.wit.com/gui"
+ "go.wit.com/lib/gui/prep"
"go.wit.com/log"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
)
@@ -26,16 +26,19 @@ import (
var VERSION string
var BUILDTIME string
+var ARGNAME string = "gus"
+
//go:embed resources/*
var resources embed.FS
func main() {
- var pp *arg.Parser
- gui.InitArg()
- pp = arg.MustParse(&argv)
+ me = new(gusconf)
+ prep.Bash(ARGNAME, argv.DoAutoComplete) // this line should be: prep.Bash(argv)
+ me.myGui = prep.Gui() // prepares the GUI package for go-args
+ me.pp = arg.MustParse(&argv)
- if pp == nil {
- pp.WriteHelp(os.Stdout)
+ if me.pp == nil {
+ me.pp.WriteHelp(os.Stdout)
os.Exit(0)
}
log.Info("tmp hack", uuid.New().String())
@@ -66,16 +69,17 @@ func main() {
os.Exit(0)
}
- if gui.NoGui() {
- startGus()
- startHTTP()
- os.Exit(0)
+ startGus()
+
+ if argv.Gui != nil {
+ me.myGui.Start() // loads the GUI toolkit
+ doGui() // start making our forge GUI
}
- startGus()
+ startHTTP()
+ os.Exit(0)
+ // debug() // sits here forever
// go NewWatchdog()
- go startHTTP()
- doGui()
}
func startGus() {