Browse Source

etcdctl/ctlv3: remove ETCDCTL_API warning

To make coverage stats happy https://codecov.io/gh/coreos/etcd/commit/25bc65794f6802cb24b40c3a46de9ab3fa5f9e6b.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Gyuho Lee 7 years ago
parent
commit
85e3c5ec37
3 changed files with 3 additions and 17 deletions
  1. 1 8
      etcdctl/ctlv3/ctl_cov.go
  2. 1 8
      etcdctl/ctlv3/ctl_nocov.go
  3. 1 1
      etcdctl/main.go

+ 1 - 8
etcdctl/ctlv3/ctl_cov.go

@@ -23,16 +23,9 @@ import (
 	"github.com/coreos/etcd/etcdctl/ctlv3/command"
 )
 
-func Start(apiv string) {
+func Start() {
 	// ETCDCTL_ARGS=etcdctl_test arg1 arg2...
 	// SetArgs() takes arg1 arg2...
-	if apiv == "" {
-		rootCmd.Short += "\n\n" +
-			"WARNING:\n" +
-			"        Environment variable ETCDCTL_API is not set; defaults to etcdctl v3.\n" +
-			"        Set environment variable ETCDCTL_API=2 to use v2 API or ETCDCTL_API=3 to use v3 API."
-
-	}
 	rootCmd.SetArgs(strings.Split(os.Getenv("ETCDCTL_ARGS"), "\xe7\xcd")[1:])
 	os.Unsetenv("ETCDCTL_ARGS")
 	if err := rootCmd.Execute(); err != nil {

+ 1 - 8
etcdctl/ctlv3/ctl_nocov.go

@@ -18,14 +18,7 @@ package ctlv3
 
 import "github.com/coreos/etcd/etcdctl/ctlv3/command"
 
-func Start(apiv string) {
-	if apiv == "" {
-		rootCmd.Short += "\n\n" +
-			"WARNING:\n" +
-			"        Environment variable ETCDCTL_API is not set; defaults to etcdctl v3.\n" +
-			"        Set environment variable ETCDCTL_API=2 to use v2 API or ETCDCTL_API=3 to use v3 API."
-
-	}
+func Start() {
 	rootCmd.SetUsageFunc(usageFunc)
 	// Make help just show the usage
 	rootCmd.SetHelpTemplate(`{{.UsageString}}`)

+ 1 - 1
etcdctl/main.go

@@ -32,7 +32,7 @@ func main() {
 	// unset apiEnv to avoid side-effect for future env and flag parsing.
 	os.Unsetenv(apiEnv)
 	if len(apiv) == 0 || apiv == "3" {
-		ctlv3.Start(apiv)
+		ctlv3.Start()
 		return
 	}