Example #1
0
 public static void main(String[] args) {
   try {
     JApiCmp app = new JApiCmp();
     app.run(args);
   } catch (JApiCmpException e) {
     if (e.getReason() == JApiCmpException.Reason.CliMissingMandatoryOption
         || e.getReason() == JApiCmpException.Reason.CliMissingArgumentForOption) {
       System.err.println(e.getMessage());
       CliParser.printHelp();
     } else if (e.getReason() != JApiCmpException.Reason.NormalTermination) {
       System.err.println(e.getMessage());
     }
     System.exit(-1);
   } catch (Exception e) {
     System.err.println(
         String.format(
             "Execution of %s failed: %s", JApiCmp.class.getSimpleName(), e.getMessage()));
     System.exit(-2);
   }
 }
Example #2
0
 private Options parseCliOptions(String[] args) {
   CliParser cliParser = new CliParser();
   return cliParser.parse(args);
 }