use of com.github.rvesse.airline.parser.errors.ParseException in project jena by apache.
the class RdfStats method run.
@Override
public int run(String[] args) {
try (ColorizedOutputStream<BasicColor> error = new AnsiBasicColorizedOutputStream(new CloseShieldOutputStream(System.err))) {
try {
if (args.length == 0) {
showUsage();
}
// Parse custom arguments
RdfStats cmd = SingleCommand.singleCommand(RdfStats.class).parse(args);
// Copy Hadoop configuration across
cmd.setConf(this.getConf());
// Show help if requested and exit with success
if (cmd.helpOption.showHelpIfRequested()) {
return 0;
}
// Run the command and exit with success
cmd.run();
return 0;
} catch (ParseException e) {
error.setForegroundColor(BasicColor.RED);
error.println(e.getMessage());
error.println();
} catch (Throwable e) {
error.setForegroundColor(BasicColor.RED);
error.println(e.getMessage());
e.printStackTrace(error);
error.println();
}
}
return 1;
}
Aggregations