Skip to content
This repository was archived by the owner on Jun 4, 2019. It is now read-only.

Commit 507dbf1

Browse files
committed
Merge pull request #53 from xiangli-cmu/extend_format
feat(handle.go) extended format support createIndex and prevNode value
2 parents 5bed726 + 2aa8bc9 commit 507dbf1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

command/handle.go

+6
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ func printKey(resp *etcd.Response, format string) {
8383
case "extended":
8484
// Extended prints in a rfc2822 style format
8585
fmt.Println("Key:", resp.Node.Key)
86+
fmt.Println("Created-Index:", resp.Node.CreatedIndex)
8687
fmt.Println("Modified-Index:", resp.Node.ModifiedIndex)
88+
89+
if resp.PrevNode != nil {
90+
fmt.Println("PrevNode.Value:", resp.PrevNode.Value)
91+
}
92+
8793
fmt.Println("TTL:", resp.Node.TTL)
8894
fmt.Println("Etcd-Index:", resp.EtcdIndex)
8995
fmt.Println("Raft-Index:", resp.RaftIndex)

0 commit comments

Comments
 (0)