Merge pull request #4591 from heyitsanthony/etcdctlv3-nuke-teletypes

etcdctlv3: use "\n" as output line separator
This commit is contained in:
Anthony Romano 2016-02-22 22:19:26 -08:00
commit c48bafae85
3 changed files with 5 additions and 4 deletions

View File

@ -62,7 +62,7 @@ TODO: add consistency, from, prefix
Simple reply
- \<key\>\r\n\<value\>\r\n\<next_key\>\r\n\<next_value\>...
- \<key\>\n\<value\>\n\<next_key\>\n\<next_value\>...
- 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
- \<event\>\<key\>\r\n\<value\>\r\n\<event\>\<next_key\>\r\n\<next_value\>...
- \<event\>\<key\>\n\<value\>\n\<event\>\<next_key\>\n\<next_value\>...
- Additional error string if WATCH failed. Exit code is non-zero.

View File

@ -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 {

View File

@ -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)
}
}