diff --git a/etcdctl/ctlv3/command/get_command.go b/etcdctl/ctlv3/command/get_command.go index 769a95d49765..847fc93777fd 100644 --- a/etcdctl/ctlv3/command/get_command.go +++ b/etcdctl/ctlv3/command/get_command.go @@ -26,6 +26,7 @@ import ( var ( getConsistency string getLimit int64 + getMaxBytes int64 getSortOrder string getSortTarget string getPrefix bool @@ -48,6 +49,7 @@ func NewGetCommand() *cobra.Command { cmd.Flags().StringVar(&getSortOrder, "order", "", "Order of results; ASCEND or DESCEND (ASCEND by default)") 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(&getMaxBytes, "max-bytes", 0, "Maximum bytes of results") 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 using byte compare") cmd.Flags().Int64Var(&getRev, "rev", 0, "Specify the kv revision") @@ -125,6 +127,7 @@ func getGetOp(args []string) (string, []clientv3.OpOption) { } opts = append(opts, clientv3.WithLimit(getLimit)) + opts = append(opts, clientv3.WithMaxBytes(getMaxBytes)) if getRev > 0 { opts = append(opts, clientv3.WithRev(getRev)) }