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