installSecurityProviderWorkaround();
// Configuring the logger needs to happen before any logger is initialized
- configureLogging(isVerbose(args));
+ final var isVerbose = isVerbose(args);
+ configureLogging(isVerbose);
var parser = App.buildArgumentParser();
new App(ns).init();
} catch (CommandException e) {
System.err.println(e.getMessage());
+ if (isVerbose && e.getCause() != null) {
+ e.getCause().printStackTrace();
+ }
status = getStatusForError(e);
+ } catch (Throwable e) {
+ e.printStackTrace();
+ status = 2;
}
System.exit(status);
}
return false;
}
- return ns.getBoolean("verbose");
+ return Boolean.TRUE.equals(ns.getBoolean("verbose"));
}
private static void configureLogging(final boolean verbose) {