Main method @param args the arguments passed to the command line version @throws Exception if something wrong happens
(String[] args)
| 80 | * @throws Exception if something wrong happens |
| 81 | */ |
| 82 | public static void main(String[] args) throws Exception { |
| 83 | setCustomErrStream(); |
| 84 | |
| 85 | CommandLine cmdLine = null; |
| 86 | try { |
| 87 | cmdLine = new CommandLine(args != null ? Arrays.copyOf(args, args.length) : null); |
| 88 | |
| 89 | } catch (final Exception e) { |
| 90 | // Cant use the CommandLine help here as the |
| 91 | // i18n messages wont have been loaded |
| 92 | System.out.println("Failed due to invalid parameters: " + Arrays.toString(args)); |
| 93 | System.out.println(e.getMessage()); |
| 94 | System.out.println("Use '-h' for more details."); |
| 95 | System.exit(1); |
| 96 | } |
| 97 | |
| 98 | ZapBootstrap bootstrap = createZapBootstrap(cmdLine); |
| 99 | try { |
| 100 | int rc = bootstrap.start(); |
| 101 | if (rc != 0) { |
| 102 | System.exit(rc); |
| 103 | } |
| 104 | |
| 105 | } catch (final Exception e) { |
| 106 | LOGGER.fatal(e.getMessage(), e); |
| 107 | System.exit(1); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | private static void setCustomErrStream() { |
| 112 | System.setErr( |
nothing calls this directly
no test coverage detected