Browse Source

Merge pull request #4250 from mitake/ls-quorum

etcdctl: add an option to ls for consistent result
Anthony Romano 10 years ago
parent
commit
1ec71c1cdc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      etcdctl/command/ls_command.go

+ 3 - 1
etcdctl/command/ls_command.go

@@ -30,6 +30,7 @@ func NewLsCommand() cli.Command {
 			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: "p", Usage: "append slash (/) to directories"},
+			cli.BoolFlag{Name: "quorum", Usage: "require quorum for get request"},
 		},
 		Action: func(c *cli.Context) {
 			lsCommandFunc(c, mustNewKeyAPI(c))
@@ -46,9 +47,10 @@ func lsCommandFunc(c *cli.Context, ki client.KeysAPI) {
 
 	sort := c.Bool("sort")
 	recursive := c.Bool("recursive")
+	quorum := c.Bool("quorum")
 
 	ctx, cancel := contextWithTotalTimeout(c)
-	resp, err := ki.Get(ctx, key, &client.GetOptions{Sort: sort, Recursive: recursive})
+	resp, err := ki.Get(ctx, key, &client.GetOptions{Sort: sort, Recursive: recursive, Quorum: quorum})
 	cancel()
 	if err != nil {
 		handleError(ExitServerError, err)