etcdctlv3: separate out cmd parsing logic for creating client

This commit is contained in:
Xiang Li
2016-02-15 14:44:25 -08:00
parent 03a7f2e10f
commit d78cff2c4a
10 changed files with 44 additions and 27 deletions

View File

@ -44,7 +44,7 @@ func deleteRangeCommandFunc(cmd *cobra.Command, args []string) {
}
req := &pb.DeleteRangeRequest{Key: key, RangeEnd: rangeEnd}
mustClient(cmd).KV.DeleteRange(context.Background(), req)
mustClientFromCmd(cmd).KV.DeleteRange(context.Background(), req)
if rangeEnd != nil {
fmt.Printf("range [%s, %s) is deleted\n", string(key), string(rangeEnd))