(CommandLine cli)
| 85 | } |
| 86 | |
| 87 | @Override |
| 88 | public int runTool(CommandLine cli) throws Exception { |
| 89 | verbose = cli.hasOption(CommonCLIOptions.VERBOSE_OPTION); |
| 90 | raiseLogLevelUnlessVerbose(); |
| 91 | |
| 92 | int toolExitStatus = 0; |
| 93 | try { |
| 94 | runImpl(cli); |
| 95 | } catch (Exception exc) { |
| 96 | // since this is a CLI, spare the user the stacktrace |
| 97 | String excMsg = exc.getMessage(); |
| 98 | if (excMsg != null) { |
| 99 | CLIO.err("\nERROR: " + excMsg + "\n"); |
| 100 | if (verbose) { |
| 101 | exc.printStackTrace(CLIO.getErrStream()); |
| 102 | } |
| 103 | toolExitStatus = 1; |
| 104 | } else { |
| 105 | throw exc; |
| 106 | } |
| 107 | } |
| 108 | return toolExitStatus; |
| 109 | } |
| 110 | |
| 111 | private void raiseLogLevelUnlessVerbose() { |
| 112 | if (!verbose) { |
nothing calls this directly
no test coverage detected