etcdctl: add ttl unit to flag description
Add the ttl unit (seconds) to --ttl description for etcdctl's mk, mkdir, set, setdir, update, and updatedir commands.
This commit is contained in:
@ -31,7 +31,7 @@ func NewMakeCommand() cli.Command {
|
|||||||
ArgsUsage: "<key> <value>",
|
ArgsUsage: "<key> <value>",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.BoolFlag{Name: "in-order", Usage: "create in-order key under directory <key>"},
|
cli.BoolFlag{Name: "in-order", Usage: "create in-order key under directory <key>"},
|
||||||
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
|
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live in seconds"},
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
mkCommandFunc(c, mustNewKeyAPI(c))
|
mkCommandFunc(c, mustNewKeyAPI(c))
|
||||||
|
@ -29,7 +29,7 @@ func NewMakeDirCommand() cli.Command {
|
|||||||
Usage: "make a new directory",
|
Usage: "make a new directory",
|
||||||
ArgsUsage: "<key>",
|
ArgsUsage: "<key>",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
|
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live in seconds"},
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
mkdirCommandFunc(c, mustNewKeyAPI(c), client.PrevNoExist)
|
mkdirCommandFunc(c, mustNewKeyAPI(c), client.PrevNoExist)
|
||||||
|
@ -36,7 +36,7 @@ func NewSetCommand() cli.Command {
|
|||||||
|
|
||||||
$ set -- <key> <value>`,
|
$ set -- <key> <value>`,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
|
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live in seconds"},
|
||||||
cli.StringFlag{Name: "swap-with-value", Value: "", Usage: "previous value"},
|
cli.StringFlag{Name: "swap-with-value", Value: "", Usage: "previous value"},
|
||||||
cli.IntFlag{Name: "swap-with-index", Value: 0, Usage: "previous index"},
|
cli.IntFlag{Name: "swap-with-index", Value: 0, Usage: "previous index"},
|
||||||
},
|
},
|
||||||
|
@ -26,7 +26,7 @@ func NewSetDirCommand() cli.Command {
|
|||||||
Usage: "create a new directory or update an existing directory TTL",
|
Usage: "create a new directory or update an existing directory TTL",
|
||||||
ArgsUsage: "<key>",
|
ArgsUsage: "<key>",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
|
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live in seconds"},
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
mkdirCommandFunc(c, mustNewKeyAPI(c), client.PrevIgnore)
|
mkdirCommandFunc(c, mustNewKeyAPI(c), client.PrevIgnore)
|
||||||
|
@ -30,7 +30,7 @@ func NewUpdateCommand() cli.Command {
|
|||||||
Usage: "update an existing key with a given value",
|
Usage: "update an existing key with a given value",
|
||||||
ArgsUsage: "<key> <value>",
|
ArgsUsage: "<key> <value>",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
|
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live in seconds"},
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
updateCommandFunc(c, mustNewKeyAPI(c))
|
updateCommandFunc(c, mustNewKeyAPI(c))
|
||||||
|
@ -29,7 +29,7 @@ func NewUpdateDirCommand() cli.Command {
|
|||||||
Usage: "update an existing directory",
|
Usage: "update an existing directory",
|
||||||
ArgsUsage: "<key> <value>",
|
ArgsUsage: "<key> <value>",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
|
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live in seconds"},
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
updatedirCommandFunc(c, mustNewKeyAPI(c))
|
updatedirCommandFunc(c, mustNewKeyAPI(c))
|
||||||
|
Reference in New Issue
Block a user