Skip to content

Commit

Permalink
etcdctl: document watch exec in v3
Browse files Browse the repository at this point in the history
Signed-off-by: Gyu-Ho Lee <[email protected]>
  • Loading branch information
gyuho committed Dec 20, 2017
1 parent 904513f commit e89fc20
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion etcdctl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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".

Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit e89fc20

Please sign in to comment.