etcdctl: update to meet go vet

This commit is contained in:
Brian Waldon 2014-10-22 17:51:40 -07:00
parent 69842b344d
commit 1539d5c49c
12 changed files with 24 additions and 26 deletions

View File

@ -18,8 +18,8 @@ func NewExecWatchCommand() cli.Command {
Name: "exec-watch",
Usage: "watch a key for changes and exec an executable",
Flags: []cli.Flag{
cli.IntFlag{"after-index", 0, "watch after the given index"},
cli.BoolFlag{"recursive", "watch all values for key and child keys"},
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"},
},
Action: func(c *cli.Context) {
handleKey(c, execWatchCommandFunc)
@ -92,8 +92,6 @@ func execWatchCommandFunc(c *cli.Context, client *etcd.Client) (*etcd.Response,
go io.Copy(os.Stderr, stderr)
cmd.Wait()
}
return nil, nil
}
func environResponse(resp *etcd.Response, env []string) []string {

View File

@ -15,8 +15,8 @@ func NewGetCommand() cli.Command {
Name: "get",
Usage: "retrieve the value of a key",
Flags: []cli.Flag{
cli.BoolFlag{"sort", "returns result in sorted order"},
cli.BoolFlag{"consistent", "send request to the leader, thereby guranteeing that any earlier writes will be seen by the read"},
cli.BoolFlag{Name: "sort", Usage: "returns result in sorted order"},
cli.BoolFlag{Name: "consistent", Usage: "send request to the leader, thereby guranteeing that any earlier writes will be seen by the read"},
},
Action: func(c *cli.Context) {
handleGet(c, getCommandFunc)

View File

@ -12,7 +12,7 @@ func NewLsCommand() cli.Command {
Name: "ls",
Usage: "retrieve a directory",
Flags: []cli.Flag{
cli.BoolFlag{"recursive", "returns all values for key and child keys"},
cli.BoolFlag{Name: "recursive", Usage: "returns all values for key and child keys"},
},
Action: func(c *cli.Context) {
handleLs(c, lsCommandFunc)

View File

@ -14,7 +14,7 @@ func NewMakeCommand() cli.Command {
Name: "mk",
Usage: "make a new key with a given value",
Flags: []cli.Flag{
cli.IntFlag{"ttl", 0, "key time-to-live"},
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
},
Action: func(c *cli.Context) {
handleKey(c, makeCommandFunc)

View File

@ -13,7 +13,7 @@ func NewMakeDirCommand() cli.Command {
Name: "mkdir",
Usage: "make a new directory",
Flags: []cli.Flag{
cli.IntFlag{"ttl", 0, "key time-to-live"},
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
},
Action: func(c *cli.Context) {
handleDir(c, makeDirCommandFunc)

View File

@ -13,10 +13,10 @@ func NewRemoveCommand() cli.Command {
Name: "rm",
Usage: "remove a key",
Flags: []cli.Flag{
cli.BoolFlag{"dir", "removes the key if it is an empty directory or a key-value pair"},
cli.BoolFlag{"recursive", "removes the key and all child keys(if it is a directory)"},
cli.StringFlag{"with-value", "", "previous value"},
cli.IntFlag{"with-index", 0, "previous index"},
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.StringFlag{Name: "with-value", Value: "", Usage: "previous value"},
cli.IntFlag{Name: "with-index", Value: 0, Usage: "previous index"},
},
Action: func(c *cli.Context) {
handleAll(c, removeCommandFunc)

View File

@ -14,9 +14,9 @@ func NewSetCommand() cli.Command {
Name: "set",
Usage: "set the value of a key",
Flags: []cli.Flag{
cli.IntFlag{"ttl", 0, "key time-to-live"},
cli.StringFlag{"swap-with-value", "", "previous value"},
cli.IntFlag{"swap-with-index", 0, "previous index"},
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
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) {
handleKey(c, setCommandFunc)

View File

@ -13,7 +13,7 @@ func NewSetDirCommand() cli.Command {
Name: "setdir",
Usage: "create a new or existing directory",
Flags: []cli.Flag{
cli.IntFlag{"ttl", 0, "key time-to-live"},
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
},
Action: func(c *cli.Context) {
handleDir(c, setDirCommandFunc)

View File

@ -14,7 +14,7 @@ func NewUpdateCommand() cli.Command {
Name: "update",
Usage: "update an existing key with a given value",
Flags: []cli.Flag{
cli.IntFlag{"ttl", 0, "key time-to-live"},
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
},
Action: func(c *cli.Context) {
handleKey(c, updateCommandFunc)

View File

@ -13,7 +13,7 @@ func NewUpdateDirCommand() cli.Command {
Name: "updatedir",
Usage: "update an existing directory",
Flags: []cli.Flag{
cli.IntFlag{"ttl", 0, "key time-to-live"},
cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
},
Action: func(c *cli.Context) {
handleDir(c, updateDirCommandFunc)

View File

@ -15,9 +15,9 @@ func NewWatchCommand() cli.Command {
Name: "watch",
Usage: "watch a key for changes",
Flags: []cli.Flag{
cli.BoolFlag{"forever", "forever watch a key until CTRL+C"},
cli.IntFlag{"after-index", 0, "watch after the given index"},
cli.BoolFlag{"recursive", "returns all values for key and child keys"},
cli.BoolFlag{Name: "forever", 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"},
},
Action: func(c *cli.Context) {
handleKey(c, watchCommandFunc)

View File

@ -15,10 +15,10 @@ func main() {
app.Version = version.Version
app.Usage = "A simple command line client for etcd."
app.Flags = []cli.Flag{
cli.BoolFlag{"debug", "output cURL commands which can be used to reproduce the request"},
cli.BoolFlag{"no-sync", "don't synchronize cluster information before sending request"},
cli.StringFlag{"output, o", "simple", "output response in the given format (`simple` or `json`)"},
cli.StringFlag{"peers, C", "", "a comma-delimited list of machine addresses in the cluster (default: \"127.0.0.1:4001\")"},
cli.BoolFlag{Name: "debug", Usage: "output cURL commands which can be used to reproduce the request"},
cli.BoolFlag{Name: "no-sync", Usage: "don't synchronize cluster information before sending request"},
cli.StringFlag{Name: "output, o", Value: "simple", Usage: "output response in the given format (`simple` or `json`)"},
cli.StringFlag{Name: "peers, C", Value: "", Usage: "a comma-delimited list of machine addresses in the cluster (default: \"127.0.0.1:4001\")"},
}
app.Commands = []cli.Command{
command.NewMakeCommand(),