mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #4591 from heyitsanthony/etcdctlv3-nuke-teletypes
etcdctlv3: use "\n" as output line separator
This commit is contained in:
commit
c48bafae85
@ -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.
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user