Merge pull request #10402 from markmc/interactive-watch-panic

etcdctl: fix interactive mode panic
This commit is contained in:
Xiang Li 2019-01-16 11:40:34 +08:00 committed by GitHub
commit a00bff7848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,6 +101,10 @@ func watchInteractiveFunc(cmd *cobra.Command, osArgs []string, envKey, envRange
l = strings.TrimSuffix(l, "\n")
args := argify(l)
if len(args) < 1 {
fmt.Fprintf(os.Stderr, "Invalid command: %s (watch and progress supported)\n", l)
continue
}
switch args[0] {
case "watch":
if len(args) < 2 && envKey == "" {