etcdctl: document watch exec in v3

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
release-3.3
Gyu-Ho Lee 2017-11-26 23:55:47 -08:00 committed by Gyuho Lee
parent 904513fa5c
commit e89fc20542
1 changed files with 22 additions and 1 deletions

View File

@ -337,7 +337,7 @@ Prints the compacted revision.
# compacted revision 1234
```
### WATCH [options] [key or prefix] [range_end]
### WATCH [options] [key or prefix] [range_end] [--] [exec-command arg1 arg2 ...]
Watch watches events stream on keys or prefixes, [key or prefix, range_end) if `range-end` is given. The watch command runs until it encounters an error or is terminated by the user. If range_end is given, it must be lexicographically greater than key or "\x00".
@ -378,6 +378,16 @@ watch [options] <key or prefix>\n
# bar
```
Receive events and execute `echo watch event received`:
```bash
./etcdctl watch foo -- echo watch event received
# PUT
# foo
# bar
# watch event received
```
##### Interactive
```bash
@ -392,6 +402,17 @@ watch foo
# bar
```
Receive events and execute `echo watch event received`:
```bash
./etcdctl watch -i
watch foo -- echo watch event received
# PUT
# foo
# bar
# watch event received
```
### LEASE \<subcommand\>
LEASE provides commands for key lease management.