etcdctl/ctlv2/command/set_command.go
func NewSetCommand() cli.Command {
	return 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 in seconds"},
			cli.StringFlag{Name: "swap-with-value", Value: "", Usage: "previous value"},
			cli.IntFlag{Name: "swap-with-index", Value: 0, Usage: "previous index"},
		},
		Action: func(c *cli.Context) error {
			setCommandFunc(c, mustNewKeyAPI(c))
			return nil
		},
	}
}
func NewSetCommand() cli.Command {
	return 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 in seconds"},
			cli.StringFlag{Name: "swap-with-value", Value: "", Usage: "previous value"},
			cli.IntFlag{Name: "swap-with-index", Value: 0, Usage: "previous index"},
		},
		Action: func(c *cli.Context) error {
			setCommandFunc(c, mustNewKeyAPI(c))
			return nil
		},
	}
}
// NewSetCommand returns the CLI command for "set".