public void execute(GalenArguments arguments) throws Exception {
if (arguments.getAction() != null) {
FailureListener failureListener = new FailureListener();
CombinedListener combinedListener = createListeners(arguments);
combinedListener.add(failureListener);
if (listener != null) {
combinedListener.add(listener);
}
if ("test".equals(arguments.getAction())) {
runTests(arguments, combinedListener);
}
else if ("check".equals(arguments.getAction())) {
performCheck(arguments, combinedListener);
}
else if ("config".equals(arguments.getAction())) {
performConfig();
}
else if ("dump".equals(arguments.getAction())) {
performPageDump(arguments);
}
combinedListener.done();
if (GalenConfig.getConfig().getUseFailExitCode()){
if (failureListener.hasFailures()) {
System.exit(1);
}