mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
ctlv3: support del all keys by '--prefix'
This commit is contained in:
parent
5457c029d7
commit
fac20b228d
@ -72,7 +72,12 @@ func getDelOp(cmd *cobra.Command, args []string) (string, []clientv3.OpOption) {
|
||||
}
|
||||
|
||||
if delPrefix {
|
||||
opts = append(opts, clientv3.WithPrefix())
|
||||
if len(key) == 0 {
|
||||
key = "\x00"
|
||||
opts = append(opts, clientv3.WithFromKey())
|
||||
} else {
|
||||
opts = append(opts, clientv3.WithPrefix())
|
||||
}
|
||||
}
|
||||
if delPrevKV {
|
||||
opts = append(opts, clientv3.WithPrevKV())
|
||||
|
Loading…
x
Reference in New Issue
Block a user