mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctlv3: updated readme for options and examples for get command
This commit is contained in:
parent
095cff4415
commit
9743ee8b83
@ -72,7 +72,11 @@ GET gets the key or a range of keys [key, range_end) if `range-end` is given.
|
|||||||
|
|
||||||
- print-value-only -- print only value when used with write-out=simple
|
- print-value-only -- print only value when used with write-out=simple
|
||||||
|
|
||||||
TODO: add consistency, from, prefix
|
- consistency -- Linearizable(l) or Serializable(s)
|
||||||
|
|
||||||
|
- from-key -- Get keys that are greater than or equal to the given key using byte compare
|
||||||
|
|
||||||
|
- keys-only -- Get only the keys
|
||||||
|
|
||||||
#### Return value
|
#### Return value
|
||||||
|
|
||||||
@ -93,9 +97,29 @@ The protobuf encoding of the [RPC message][etcdrpc] for a key-value pair for eac
|
|||||||
#### Examples
|
#### Examples
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
./etcdctl put foo bar
|
||||||
|
# OK
|
||||||
|
./etcdctl put foo1 bar1
|
||||||
|
# OK
|
||||||
|
./etcdctl put foo2 bar2
|
||||||
|
# OK
|
||||||
|
./etcdctl put foo3 bar3
|
||||||
|
# OK
|
||||||
./etcdctl get foo
|
./etcdctl get foo
|
||||||
# foo
|
# foo
|
||||||
# bar
|
# bar
|
||||||
|
./etcdctl get --from-key foo1
|
||||||
|
# foo1
|
||||||
|
# bar1
|
||||||
|
# foo2
|
||||||
|
# bar2
|
||||||
|
# foo3
|
||||||
|
# bar3
|
||||||
|
./etcdctl get foo1 foo3
|
||||||
|
# foo1
|
||||||
|
# bar1
|
||||||
|
# foo2
|
||||||
|
# bar2
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Notes
|
#### Notes
|
||||||
|
@ -47,7 +47,7 @@ func NewGetCommand() *cobra.Command {
|
|||||||
cmd.Flags().StringVar(&getSortTarget, "sort-by", "", "Sort target; CREATE, KEY, MODIFY, VALUE, or VERSION")
|
cmd.Flags().StringVar(&getSortTarget, "sort-by", "", "Sort target; CREATE, KEY, MODIFY, VALUE, or VERSION")
|
||||||
cmd.Flags().Int64Var(&getLimit, "limit", 0, "Maximum number of results")
|
cmd.Flags().Int64Var(&getLimit, "limit", 0, "Maximum number of results")
|
||||||
cmd.Flags().BoolVar(&getPrefix, "prefix", false, "Get keys with matching prefix")
|
cmd.Flags().BoolVar(&getPrefix, "prefix", false, "Get keys with matching prefix")
|
||||||
cmd.Flags().BoolVar(&getFromKey, "from-key", false, "Get keys that are greater than or equal to the given key")
|
cmd.Flags().BoolVar(&getFromKey, "from-key", false, "Get keys that are greater than or equal to the given key using byte compare")
|
||||||
cmd.Flags().Int64Var(&getRev, "rev", 0, "Specify the kv revision")
|
cmd.Flags().Int64Var(&getRev, "rev", 0, "Specify the kv revision")
|
||||||
cmd.Flags().BoolVar(&getKeysOnly, "keys-only", false, "Get only the keys")
|
cmd.Flags().BoolVar(&getKeysOnly, "keys-only", false, "Get only the keys")
|
||||||
cmd.Flags().BoolVar(&printValueOnly, "print-value-only", false, `Only write values when using the "simple" output format`)
|
cmd.Flags().BoolVar(&printValueOnly, "print-value-only", false, `Only write values when using the "simple" output format`)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user