summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go36
1 files changed, 12 insertions, 24 deletions
diff --git a/main.go b/main.go
index 143045f..41525c3 100644
--- a/main.go
+++ b/main.go
@@ -8,8 +8,7 @@ import (
"time"
"go.wit.com/dev/alexflint/arg"
- "go.wit.com/gui"
- "go.wit.com/lib/fhelp"
+ "go.wit.com/lib/gui/prep"
"go.wit.com/lib/protobuf/zoopb"
"go.wit.com/log"
)
@@ -21,29 +20,10 @@ var ARGNAME string = "zookeeper"
func main() {
me = new(mainType)
- gui.InitArg()
+ 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 argv.Bash {
- fhelp.DoBash(ARGNAME)
- os.Exit(0)
- }
- if len(argv.BashAuto) != 0 {
- argv.doBashAuto()
- os.Exit(0)
- }
-
- // check if the binary is being called to test
- // if the plugin can actually loaded. This is a hack
- // around needing a Test() plugin load function in GO
- if gui.IsGoPluginTestHack() {
- argv.NoPort = true
- gui.CheckPlugin()
- os.Exit(0)
- // if argv.GuiCheck != "" {
- // }
- }
-
if argv.Daemon {
// turn off timestamps for STDOUT (systemd adds them)
log.DaemonMode(true)
@@ -65,5 +45,13 @@ func main() {
if !argv.NoPort {
go startHTTP()
}
- doGui()
+
+ me.myGui.Start() // loads the GUI toolkit
+ doGui() // start making our forge GUI
+
+ // sit here forever refreshing the GUI
+ for {
+ refresh()
+ time.Sleep(90 * time.Second)
+ }
}