Cli tools: make sure that the status code is returned from scripts

The status code wasn't returned from java mains (always 0), also it got lost anyway within our scripts that are calling the java mains.

Relates to elastic/elasticsearch#142

Original commit: elastic/x-pack-elasticsearch@db62486605
This commit is contained in:
javanna 2014-10-10 14:40:42 +02:00 committed by Luca Cavanna
parent bad27996f9
commit f2aca1e9bc
2 changed files with 4 additions and 2 deletions

View File

@ -40,7 +40,8 @@ public class ESUsersTool extends CliTool {
.build();
public static void main(String[] args) {
new ESUsersTool().execute(args);
int status = new ESUsersTool().execute(args);
System.exit(status);
}
public ESUsersTool() {

View File

@ -27,7 +27,8 @@ import static org.elasticsearch.common.cli.CliToolConfig.config;
public class SystemKeyTool extends CliTool {
public static void main(String[] args) throws Exception {
new SystemKeyTool().execute(args);
int status = new SystemKeyTool().execute(args);
System.exit(status);
}
private static final CliToolConfig CONFIG = config("syskey", SystemKeyTool.class)