From d37afffb9875bac6add874e8cdd5e5eab1c21960 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Sun, 14 Jan 2018 01:46:21 -0800 Subject: [PATCH] etcdctl: document watch with ETCDCTL_WATCH_* Signed-off-by: Gyuho Lee --- etcdctl/README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/etcdctl/README.md b/etcdctl/README.md index 6a438080d..08a5cf337 100644 --- a/etcdctl/README.md +++ b/etcdctl/README.md @@ -378,6 +378,13 @@ watch [options] \n # bar ``` +```bash +ETCDCTL_WATCH_KEY=foo ./etcdctl watch +# PUT +# foo +# bar +``` + Receive events and execute `echo watch event received`: ```bash @@ -388,6 +395,27 @@ Receive events and execute `echo 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 ```bash @@ -413,6 +441,29 @@ watch foo -- echo 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 \ LEASE provides commands for key lease management.