From 31a2377d46f4f0c28a4d45b74768104b0647ce48 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Thu, 9 Jul 2015 17:18:59 +0000 Subject: Add -f flag for socket path. --- xmppbot.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xmppbot.go b/xmppbot.go index ecd00f9..72ab777 100644 --- a/xmppbot.go +++ b/xmppbot.go @@ -1,6 +1,7 @@ package main import ( + "flag" "fmt" "strings" "time" @@ -13,7 +14,6 @@ import ( "github.com/bjc/goctl" ) -const sockPath = "/tmp/xmppbot" const timeout = 1 * time.Second var ( @@ -101,6 +101,10 @@ func pingHandler(args []string) string { } func main() { + var sockPath string + flag.StringVar(&sockPath, "f", "/tmp/xmppbot", "path to UNIX control socket") + flag.Parse() + stopChan = make(chan bool, 1) goctl.Logger.SetHandler(log15.StdoutHandler) -- cgit v1.2.3