diff --git a/etcdctl/command/set_command.go b/etcdctl/command/set_command.go index 9a64a78e9..589701f5a 100644 --- a/etcdctl/command/set_command.go +++ b/etcdctl/command/set_command.go @@ -29,6 +29,12 @@ func NewSetCommand() cli.Command { Name: "set", Usage: "set the value of a key", ArgsUsage: " ", + Description: `Set sets the value of a key. + + When begins with '-', is interpreted as a flag. + Insert '--' for workaround: + + $ set -- `, Flags: []cli.Flag{ cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"}, cli.StringFlag{Name: "swap-with-value", Value: "", Usage: "previous value"}, diff --git a/etcdctlv3/command/put_command.go b/etcdctlv3/command/put_command.go index 7b587cc23..2225aa1fb 100644 --- a/etcdctlv3/command/put_command.go +++ b/etcdctlv3/command/put_command.go @@ -31,9 +31,18 @@ var ( // NewPutCommand returns the cobra command for "put". func NewPutCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "put", + Use: "put [options] ", Short: "Put puts the given key into the store.", - Run: putCommandFunc, + Long: ` +Put puts the given key into the store. + +When begins with '-', is interpreted as a flag. +Insert '--' for workaround: + +$ put -- +$ put -- +`, + Run: putCommandFunc, } cmd.Flags().StringVar(&leaseStr, "lease", "0", "lease ID attached to the put key") return cmd