Ejemplo n.º 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);
   }
 }
Ejemplo n.º 2
0
 private Options parseCliOptions(String[] args) {
   CliParser cliParser = new CliParser();
   return cliParser.parse(args);
 }