From 4295d0db8b3b6ac379ca4072fb2868cdf835e622 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Mon, 22 Feb 2016 15:45:56 -0800 Subject: [PATCH] etcdctlv3: use "\n" as output line separator --- etcdctlv3/README.md | 4 ++-- etcdctlv3/command/util.go | 3 ++- etcdctlv3/command/watch_command.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/etcdctlv3/README.md b/etcdctlv3/README.md index 33d278a0d..27920a692 100644 --- a/etcdctlv3/README.md +++ b/etcdctlv3/README.md @@ -62,7 +62,7 @@ TODO: add consistency, from, prefix Simple reply -- \\r\n\\r\n\\r\n\... +- \\n\\n\\n\... - Error string if GET failed. Exit code is non-zero. @@ -193,7 +193,7 @@ Watch watches events stream on keys or prefixes. The watch command runs until it Simple reply -- \\\r\n\\r\n\\\r\n\... +- \\\n\\n\\\n\... - Additional error string if WATCH failed. Exit code is non-zero. diff --git a/etcdctlv3/command/util.go b/etcdctlv3/command/util.go index 9fc36ccde..0f7799c9a 100644 --- a/etcdctlv3/command/util.go +++ b/etcdctlv3/command/util.go @@ -27,7 +27,8 @@ func printKV(isHex bool, kv *pb.KeyValue) { k = addHexPrefix(hex.EncodeToString(kv.Key)) v = addHexPrefix(hex.EncodeToString(kv.Value)) } - fmt.Printf("%s\r\n%s\r\n", k, v) + fmt.Println(k) + fmt.Println(v) } func addHexPrefix(s string) string { diff --git a/etcdctlv3/command/watch_command.go b/etcdctlv3/command/watch_command.go index 025e7bf04..98668c73e 100644 --- a/etcdctlv3/command/watch_command.go +++ b/etcdctlv3/command/watch_command.go @@ -73,7 +73,7 @@ func watchCommandFunc(cmd *cobra.Command, args []string) { } for resp := range wc { for _, e := range resp.Events { - fmt.Printf("%s\r\n", e.Type) + fmt.Println(e.Type) printKV(watchHex, e.Kv) } }