summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/main.go b/main.go
index 581ef09..047f416 100644
--- a/main.go
+++ b/main.go
@@ -20,20 +20,23 @@ var BUILDTIME string
var resources embed.FS
func main() {
- var pp *arg.Parser
- pp = arg.MustParse(&argv)
+ me = new(zoodStruct)
+ me.pp = arg.MustParse(&argv)
- if pp == nil {
- pp.WriteHelp(os.Stdout)
+ if me.pp == nil {
+ me.pp.WriteHelp(os.Stdout)
os.Exit(0)
}
if argv.Daemon {
// turn off timestamps for STDOUT (systemd adds them)
log.DaemonMode(true)
+ me.machine, me.fullpath = zoopb.InitDaemon()
+ } else {
+ me.machine, me.fullpath = zoopb.InitMachine()
+
}
- me = new(stuff)
me.urlbase = "http://zookeeper.chap.wit.com:8080"
if argv.URL != "" {
log.Info("USING ARGV URL:", argv.URL)
@@ -43,8 +46,6 @@ func main() {
me.pollDelay = 3 * time.Second
me.failcountmax = 20 // die every minute if zookeeper can't be found
- me.machine = zoopb.InitMachine()
-
if argv.Test != nil {
testURL(me.urlbase, me.machine)
os.Exit(0)