diff options
author | Brian Cully <bjc@kublai.com> | 2015-07-09 17:18:59 +0000 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2015-07-09 17:18:59 +0000 |
commit | 31a2377d46f4f0c28a4d45b74768104b0647ce48 (patch) | |
tree | f8c07dbdce8ad3860794fd33e92ca50e6ee68901 | |
parent | 3f841f3c0de0e2f7dda1b376ca13c34da0b77267 (diff) | |
download | xmppbot-31a2377d46f4f0c28a4d45b74768104b0647ce48.tar.gz xmppbot-31a2377d46f4f0c28a4d45b74768104b0647ce48.zip |
Add -f flag for socket path.
-rw-r--r-- | xmppbot.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) |