migrate/starter: fix --version output

release-2.0
Yicheng Qin 2015-02-02 22:34:08 -08:00
parent 38038e476a
commit 1ce7f6e0d0
1 changed files with 7 additions and 0 deletions

View File

@ -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) {