mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #3224 from xiang90/fix_ls
etcdctl: ls takes / as default key arg
This commit is contained in:
commit
9cbeffc720
@ -15,7 +15,6 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/codegangsta/cli"
|
||||
@ -40,11 +39,11 @@ func NewLsCommand() cli.Command {
|
||||
|
||||
// lsCommandFunc executes the "ls" command.
|
||||
func lsCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
||||
if len(c.Args()) == 0 {
|
||||
handleError(ExitBadArgs, errors.New("key required"))
|
||||
key := "/"
|
||||
if len(c.Args()) != 0 {
|
||||
key = c.Args()[0]
|
||||
}
|
||||
|
||||
key := c.Args()[0]
|
||||
sort := c.Bool("sort")
|
||||
recursive := c.Bool("recursive")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user