etcdctl, etcdctlv3: add help message for non-valid value arg
Unix commands interprets argument value of first character '-' as a flag. And this won't be fixed in our upstream CLI libraries. This adds help message to show users workarounds. Addressing https://github.com/coreos/etcd/issues/2020.
This commit is contained in:
@ -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"},
|
||||
|
Reference in New Issue
Block a user