Put versions in the script and weavedns too, and report them

sudo weave version
This commit is contained in:
Michael Bridgen committed 2014-12-24 11:04:52 +00:00
1 parent 0348767d73
commit b014d98c78
3 files changed
+31 -9

No files matched your search

+18 -7
View File
@@ -2,24 +2,30 @@ package main
import (
"flag"
"fmt"
weavedns "github.com/zettio/weave/nameserver"
weavenet "github.com/zettio/weave/net"
"io"
"io/ioutil"
"net"
"os"
)
var version = "(unreleased version)"
func main() {
var (
ifaceName string
apiPath string
dnsPort int
httpPort int
wait int
watch bool
debug bool
justVersion bool
ifaceName string
apiPath string
dnsPort int
httpPort int
wait int
watch bool
debug bool
)
flag.BoolVar(&justVersion, "version", false, "print version and exit")
flag.StringVar(&ifaceName, "iface", "", "name of interface to use for multicast")
flag.StringVar(&apiPath, "api", "unix:///var/run/docker.sock", "Path to Docker API socket")
flag.IntVar(&wait, "wait", 0, "number of seconds to wait for interface to be created and come up")
@@ -29,6 +35,11 @@ func main() {
flag.BoolVar(&debug, "debug", false, "output debugging info to stderr")
flag.Parse()
if justVersion {
io.WriteString(os.Stdout, fmt.Sprintf("weavedns %s\n", version))
os.Exit(0)
}
debugOut := ioutil.Discard
if debug {
debugOut = os.Stderr