diff --git a/migrate/starter/starter.go b/migrate/starter/starter.go index 2540c8995..8fb7601a1 100644 --- a/migrate/starter/starter.go +++ b/migrate/starter/starter.go @@ -34,6 +34,7 @@ import ( "github.com/coreos/etcd/pkg/flags" "github.com/coreos/etcd/pkg/osutil" "github.com/coreos/etcd/pkg/types" + etcdversion "github.com/coreos/etcd/version" "github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context" ) @@ -69,6 +70,10 @@ func StartDesiredVersion(args []string) { if err != nil { return } + if fs.Lookup("version").Value.String() == "true" { + fmt.Println("etcd version", etcdversion.Version) + os.Exit(0) + } ver := checkInternalVersion(fs) log.Printf("starter: start etcd version %s", ver) @@ -358,6 +363,8 @@ func (v *value) Set(s string) error { return nil } +func (v *value) IsBoolFlag() bool { return true } + // parseConfig parses out the input config from cmdline arguments and // environment variables. func parseConfig(args []string) (*flag.FlagSet, error) {