|
@@ -273,7 +273,10 @@ public class ZooKeeperMain {
|
|
|
throws KeeperException, IOException, InterruptedException
|
|
|
{
|
|
|
ZooKeeperMain main = new ZooKeeperMain(args);
|
|
|
- main.run();
|
|
|
+ boolean result = main.run();
|
|
|
+ if (!result) {
|
|
|
+ System.exit(1);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public ZooKeeperMain(String args[]) throws IOException, InterruptedException {
|
|
@@ -288,7 +291,7 @@ public class ZooKeeperMain {
|
|
|
this.zk = zk;
|
|
|
}
|
|
|
|
|
|
- void run() throws KeeperException, IOException, InterruptedException {
|
|
|
+ boolean run() throws KeeperException, IOException, InterruptedException {
|
|
|
if (cl.getCommand() == null) {
|
|
|
System.out.println("Welcome to ZooKeeper!");
|
|
|
|
|
@@ -342,9 +345,10 @@ public class ZooKeeperMain {
|
|
|
executeLine(line);
|
|
|
}
|
|
|
}
|
|
|
+ return true;
|
|
|
} else {
|
|
|
// Command line args non-null. Run what was passed.
|
|
|
- processCmd(cl);
|
|
|
+ return processCmd(cl);
|
|
|
}
|
|
|
}
|
|
|
|