summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2015-07-09 17:18:59 +0000
committerBrian Cully <bjc@kublai.com>2015-07-09 17:18:59 +0000
commit31a2377d46f4f0c28a4d45b74768104b0647ce48 (patch)
treef8c07dbdce8ad3860794fd33e92ca50e6ee68901
parent3f841f3c0de0e2f7dda1b376ca13c34da0b77267 (diff)
downloadxmppbot-31a2377d46f4f0c28a4d45b74768104b0647ce48.tar.gz
xmppbot-31a2377d46f4f0c28a4d45b74768104b0647ce48.zip
Add -f flag for socket path.
-rw-r--r--xmppbot.go6
1 files changed, 5 insertions, 1 deletions
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)