[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14362695#comment-14362695
 ] 

surendra singh lilhore commented on ZOOKEEPER-2074:
---------------------------------------------------

Thanks [~michim] , [~rakeshr] Yes I will check it..

But I have one doubt, why processZKCmd() will return false if command is 
success.

when watch is false ??

{code}
         // execute from commandMap
        CliCommand cliCmd = commandMapCli.get(cmd);
        if(cliCmd != null) {
            cliCmd.setZk(zk);
            watch = cliCmd.parse(args).exec();
        } else if (!commandMap.containsKey(cmd)) {
             usage();
        }
{code}

I saw some command like "getAcl" which prints the command output on console, it 
will always return false 

{code}
        @Override
    public boolean exec() throws KeeperException, InterruptedException {
        String path = args[1];
        Stat stat = new Stat();
        List<ACL> acl = zk.getACL(path, stat);
        for (ACL a : acl) {
            out.println(a.getId() + ": "
                        + getPermString(a.getPerms()));
        }

        if (cl.hasOption("s")) {
            new StatPrinter(out).print(stat);
        }
        return false;
    }
{code}

> Incorrect exit codes for "./zkCli.sh cmd arg"
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-2074
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2074
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.5.0
>            Reporter: surendra singh lilhore
>            Assignee: surendra singh lilhore
>            Priority: Minor
>             Fix For: 3.5.1, 3.6.0
>
>         Attachments: ZOOKEEPER-2074_1.patch, ZOOKEEPER-2074_2.patch
>
>
> Linux@hghoulaslx406:/> $ZOOKEEPER_HOME/bin/zkCli.sh create /test "test"
> Created /test1
> Linux@hghoulaslx406:/> echo $?
> 0
> Linux@hghoulaslx406:/> $ZOOKEEPER_HOME/bin/zkCli.sh create /test "test"
> Node already exists: /test1
> Linux@hghoulaslx406:/> echo $?
> 0
> Linux@hghoulaslx406:/> $ZOOKEEPER_HOME/bin/zkCli.sh delete /test
> Linux@hghoulaslx406:/> echo $?
> 0
> Linux@hghoulaslx406:/> $ZOOKEEPER_HOME/bin/zkCli.sh delete /test
> Node does not exist: /test1
> Linux@hghoulaslx406:/> echo $?
> 0
> Here for failed command it should return exit code 1



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to