Skip to content
This repository was archived by the owner on Jun 4, 2019. It is now read-only.

Commit b409fee

Browse files
committed
feat(etcdctl): add version flag
1 parent 73f9c0f commit b409fee

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

etcdctl.go

+9
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@ import (
99

1010
var (
1111
client *etcd.Client
12+
13+
printVersion bool
1214
)
1315

1416
func main() {
17+
flag.BoolVar(&printVersion, "version", false, "print the version and exit")
18+
1519
cluster := ClusterValue{"http://localhost:4001"}
1620
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")
1721
flag.Parse()
1822

23+
if printVersion {
24+
fmt.Println(releaseVersion)
25+
os.Exit(0)
26+
}
27+
1928
client = etcd.NewClient(cluster.GetMachines())
2029

2130
args := flag.Args()

0 commit comments

Comments
 (0)