Browse Source

Merge pull request #6344 from glycerine/partial_fix_6343

etcdctl/ctlv3: don't crash when we should prompt for pw.
Xiang Li 9 years ago
parent
commit
2e0dc8467d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      etcdctl/ctlv3/command/global.go

+ 1 - 1
etcdctl/ctlv3/command/global.go

@@ -243,7 +243,7 @@ func authCfgFromCmd(cmd *cobra.Command) *authCfg {
 	var cfg authCfg
 
 	splitted := strings.SplitN(userFlag, ":", 2)
-	if len(splitted) == 0 {
+	if len(splitted) < 2 {
 		cfg.username = userFlag
 		cfg.password, err = speakeasy.Ask("Password: ")
 		if err != nil {