Github user lvfangmin commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/650#discussion_r221472342
--- Diff: src/java/main/org/apache/zookeeper/cli/SetAclCommand.java ---
@@ -69,9 +72,22 @@ public boolean exec() throws CliException {
version = -1;
}
try {
- Stat stat = zk.setACL(path, acl, version);
- if (cl.hasOption("s")) {
- new StatPrinter(out).print(stat);
+ if (cl.hasOption("R")) {
+ ZKUtil.visitSubTreeDFS(zk, path, false, new
StringCallback() {
+ @Override
+ public void processResult(int rc, String path, Object
ctx, String name) {
+ try {
+ zk.setACL(path, acl, version);
+ } catch (KeeperException | InterruptedException e)
{
+ out.print(e.getMessage());
+ }
+ }
+ });
+ } else {
+ Stat stat = zk.setACL(path, acl, version);
+ if (cl.hasOption("s")) {
--- End diff --
Does that mean -s and -R is exclusive with watch other?
If yes, maybe we should add it to the description, otherwise we should
implement this in -R as well.
---