mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl: Add aliases for command flags.
Add aliases to the flags that are supplied to the sub commands.
This commit is contained in:
parent
c53380cd2a
commit
2e3856740d
@ -34,7 +34,7 @@ func NewClusterHealthCommand() cli.Command {
|
||||
Usage: "check the health of the etcd cluster",
|
||||
ArgsUsage: " ",
|
||||
Flags: []cli.Flag{
|
||||
cli.BoolFlag{Name: "forever", Usage: "forever check the health every 10 second until CTRL+C"},
|
||||
cli.BoolFlag{Name: "forever, f", Usage: "forever check the health every 10 second until CTRL+C"},
|
||||
},
|
||||
Action: handleClusterHealth,
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ func NewExecWatchCommand() cli.Command {
|
||||
ArgsUsage: "<key> <command> [args...]",
|
||||
Flags: []cli.Flag{
|
||||
cli.IntFlag{Name: "after-index", Value: 0, Usage: "watch after the given index"},
|
||||
cli.BoolFlag{Name: "recursive", Usage: "watch all values for key and child keys"},
|
||||
cli.BoolFlag{Name: "recursive, r", Usage: "watch all values for key and child keys"},
|
||||
},
|
||||
Action: func(c *cli.Context) {
|
||||
execWatchCommandFunc(c, mustNewKeyAPI(c))
|
||||
|
@ -31,7 +31,7 @@ func NewGetCommand() cli.Command {
|
||||
ArgsUsage: "<key>",
|
||||
Flags: []cli.Flag{
|
||||
cli.BoolFlag{Name: "sort", Usage: "returns result in sorted order"},
|
||||
cli.BoolFlag{Name: "quorum", Usage: "require quorum for get request"},
|
||||
cli.BoolFlag{Name: "quorum, q", Usage: "require quorum for get request"},
|
||||
},
|
||||
Action: func(c *cli.Context) {
|
||||
getCommandFunc(c, mustNewKeyAPI(c))
|
||||
|
@ -28,9 +28,9 @@ func NewLsCommand() cli.Command {
|
||||
ArgsUsage: "[key]",
|
||||
Flags: []cli.Flag{
|
||||
cli.BoolFlag{Name: "sort", Usage: "returns result in sorted order"},
|
||||
cli.BoolFlag{Name: "recursive", Usage: "returns all key names recursively for the given path"},
|
||||
cli.BoolFlag{Name: "recursive, r", Usage: "returns all key names recursively for the given path"},
|
||||
cli.BoolFlag{Name: "p", Usage: "append slash (/) to directories"},
|
||||
cli.BoolFlag{Name: "quorum", Usage: "require quorum for get request"},
|
||||
cli.BoolFlag{Name: "quorum, q", Usage: "require quorum for get request"},
|
||||
},
|
||||
Action: func(c *cli.Context) {
|
||||
lsCommandFunc(c, mustNewKeyAPI(c))
|
||||
|
@ -29,7 +29,7 @@ func NewRemoveCommand() cli.Command {
|
||||
ArgsUsage: "<key>",
|
||||
Flags: []cli.Flag{
|
||||
cli.BoolFlag{Name: "dir", Usage: "removes the key if it is an empty directory or a key-value pair"},
|
||||
cli.BoolFlag{Name: "recursive", Usage: "removes the key and all child keys(if it is a directory)"},
|
||||
cli.BoolFlag{Name: "recursive, r", Usage: "removes the key and all child keys(if it is a directory)"},
|
||||
cli.StringFlag{Name: "with-value", Value: "", Usage: "previous value"},
|
||||
cli.IntFlag{Name: "with-index", Value: 0, Usage: "previous index"},
|
||||
},
|
||||
|
@ -62,7 +62,7 @@ func NewRoleCommands() cli.Command {
|
||||
cli.StringFlag{Name: "path", Value: "", Usage: "Path granted for the role to access"},
|
||||
cli.BoolFlag{Name: "read", Usage: "Grant read-only access"},
|
||||
cli.BoolFlag{Name: "write", Usage: "Grant write-only access"},
|
||||
cli.BoolFlag{Name: "readwrite", Usage: "Grant read-write access"},
|
||||
cli.BoolFlag{Name: "readwrite, rw", Usage: "Grant read-write access"},
|
||||
},
|
||||
Action: actionRoleGrant,
|
||||
},
|
||||
@ -74,7 +74,7 @@ func NewRoleCommands() cli.Command {
|
||||
cli.StringFlag{Name: "path", Value: "", Usage: "Path revoked for the role to access"},
|
||||
cli.BoolFlag{Name: "read", Usage: "Revoke read access"},
|
||||
cli.BoolFlag{Name: "write", Usage: "Revoke write access"},
|
||||
cli.BoolFlag{Name: "readwrite", Usage: "Revoke read-write access"},
|
||||
cli.BoolFlag{Name: "readwrite, rw", Usage: "Revoke read-write access"},
|
||||
},
|
||||
Action: actionRoleRevoke,
|
||||
},
|
||||
|
@ -32,9 +32,9 @@ func NewWatchCommand() cli.Command {
|
||||
Usage: "watch a key for changes",
|
||||
ArgsUsage: "<key>",
|
||||
Flags: []cli.Flag{
|
||||
cli.BoolFlag{Name: "forever", Usage: "forever watch a key until CTRL+C"},
|
||||
cli.BoolFlag{Name: "forever, f", Usage: "forever watch a key until CTRL+C"},
|
||||
cli.IntFlag{Name: "after-index", Value: 0, Usage: "watch after the given index"},
|
||||
cli.BoolFlag{Name: "recursive", Usage: "returns all values for key and child keys"},
|
||||
cli.BoolFlag{Name: "recursive, r", Usage: "returns all values for key and child keys"},
|
||||
},
|
||||
Action: func(c *cli.Context) {
|
||||
watchCommandFunc(c, mustNewKeyAPI(c))
|
||||
|
Loading…
x
Reference in New Issue
Block a user