// makeDirCommandFunc executes the "mkdir" command. func makeDirCommandFunc(c *cli.Context, client *etcd.Client) (*etcd.Response, error) { if len(c.Args()) == 0 { return nil, errors.New("Key required") } key := c.Args()[0] ttl := c.Int("ttl") return client.CreateDir(key, uint64(ttl)) }