diff --git a/etcdctl.go b/etcdctl.go index 60f87c1..2ffd378 100644 --- a/etcdctl.go +++ b/etcdctl.go @@ -9,13 +9,22 @@ import ( var ( client *etcd.Client + + printVersion bool ) func main() { + flag.BoolVar(&printVersion, "version", false, "print the version and exit") + cluster := ClusterValue{"http://localhost:4001"} flag.Var(&cluster, "C", "a comma seperated list of machine addresses in the cluster e.g. 127.0.0.1:4001,127.0.0.1:4002") flag.Parse() + if printVersion { + fmt.Println(releaseVersion) + os.Exit(0) + } + client = etcd.NewClient(cluster.GetMachines()) args := flag.Args()