浏览代码

etcdctl: document watch with ETCDCTL_WATCH_*

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Gyuho Lee 8 年之前
父节点
当前提交
57284aac28
共有 1 个文件被更改,包括 51 次插入0 次删除
  1. 51 0
      etcdctl/README.md

+ 51 - 0
etcdctl/README.md

@@ -378,6 +378,13 @@ watch [options] <key or prefix>\n
 # bar
 # bar
 ```
 ```
 
 
+```bash
+ETCDCTL_WATCH_KEY=foo ./etcdctl watch
+# PUT
+# foo
+# bar
+```
+
 Receive events and execute `echo watch event received`:
 Receive events and execute `echo watch event received`:
 
 
 ```bash
 ```bash
@@ -388,6 +395,27 @@ Receive events and execute `echo watch event received`:
 # watch event received
 # watch event received
 ```
 ```
 
 
+Watch with environmental variables and execute `echo watch event received`:
+
+```bash
+export ETCDCTL_WATCH_KEY=foo
+./etcdctl watch -- echo watch event received
+# PUT
+# foo
+# bar
+# watch event received
+```
+
+```bash
+export ETCDCTL_WATCH_KEY=foo
+export ETCDCTL_WATCH_RANGE_END=foox
+./etcdctl watch -- echo watch event received
+# PUT
+# fob
+# bar
+# watch event received
+```
+
 ##### Interactive
 ##### Interactive
 
 
 ```bash
 ```bash
@@ -413,6 +441,29 @@ watch foo -- echo watch event received
 # watch event received
 # watch event received
 ```
 ```
 
 
+Watch with environmental variables and execute `echo watch event received`:
+
+```bash
+export ETCDCTL_WATCH_KEY=foo
+./etcdctl watch -i
+watch -- echo watch event received
+# PUT
+# foo
+# bar
+# watch event received
+```
+
+```bash
+export ETCDCTL_WATCH_KEY=foo
+export ETCDCTL_WATCH_RANGE_END=foox
+./etcdctl watch -i
+watch -- echo watch event received
+# PUT
+# fob
+# bar
+# watch event received
+```
+
 ### LEASE \<subcommand\>
 ### LEASE \<subcommand\>
 
 
 LEASE provides commands for key lease management.
 LEASE provides commands for key lease management.