mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #4193 from gyuho/etcdctl_help_doc
etcdctl, etcdctlv3: add help message for non-valid value arg
This commit is contained in:
commit
b6d5993121
@ -29,6 +29,12 @@ func NewSetCommand() cli.Command {
|
||||
Name: "set",
|
||||
Usage: "set the value of a key",
|
||||
ArgsUsage: "<key> <value>",
|
||||
Description: `Set sets the value of a key.
|
||||
|
||||
When <value> begins with '-', <value> is interpreted as a flag.
|
||||
Insert '--' for workaround:
|
||||
|
||||
$ set -- <key> <value>`,
|
||||
Flags: []cli.Flag{
|
||||
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
|
||||
cli.StringFlag{Name: "swap-with-value", Value: "", Usage: "previous value"},
|
||||
|
@ -31,9 +31,18 @@ var (
|
||||
// NewPutCommand returns the cobra command for "put".
|
||||
func NewPutCommand() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "put",
|
||||
Use: "put [options] <key> <value>",
|
||||
Short: "Put puts the given key into the store.",
|
||||
Run: putCommandFunc,
|
||||
Long: `
|
||||
Put puts the given key into the store.
|
||||
|
||||
When <value> begins with '-', <value> is interpreted as a flag.
|
||||
Insert '--' for workaround:
|
||||
|
||||
$ put <key> -- <value>
|
||||
$ put -- <key> <value>
|
||||
`,
|
||||
Run: putCommandFunc,
|
||||
}
|
||||
cmd.Flags().StringVar(&leaseStr, "lease", "0", "lease ID attached to the put key")
|
||||
return cmd
|
||||
|
Loading…
x
Reference in New Issue
Block a user