From e224754f7e321ae8c457d2251730a2d67cc49a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Lindo?= Date: Fri, 3 Nov 2023 15:35:49 +0000 Subject: [PATCH] Fixed exit code logic --- dbptk-core/src/main/java/com/databasepreservation/Main.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dbptk-core/src/main/java/com/databasepreservation/Main.java b/dbptk-core/src/main/java/com/databasepreservation/Main.java index 58abaf87..23f2701b 100644 --- a/dbptk-core/src/main/java/com/databasepreservation/Main.java +++ b/dbptk-core/src/main/java/com/databasepreservation/Main.java @@ -97,7 +97,7 @@ public static int internalMain(CLI cli) { logProgramStart(); cli.logOperatingSystemInfo(); - int exitStatus = EXIT_CODE_GENERIC_ERROR; + int exitStatus = EXIT_CODE_OK; // avoid SAX processing limit of 50 million elements System.setProperty("totalEntitySizeLimit", "0"); @@ -112,7 +112,7 @@ public static int internalMain(CLI cli) { if (!cli.getRecognizedCommand()) { LOGGER.error("Command '{}' not a valid command.", cli.getArgCommand()); cli.printUsage(); - exitStatus = EXIT_CODE_OK; + exitStatus = EXIT_CODE_GENERIC_ERROR; } else { if (cli.usingUTF8()) { if (isGUI) { @@ -190,6 +190,7 @@ private static int runValidation(CLIValidate cli, CLIHelp help) { LOGGER.info("Validate SIARD at '{}'", cli.getSIARDPackage()); siardValidation.validate(); duration = System.currentTimeMillis() - startTime; + exitStatus = EXIT_CODE_OK; LOGGER.info("Validate SIARD took {}m {}s to complete.", duration / 60000, duration % 60000 / 1000); } catch (SiardNotFoundException e) { LOGGER.error("{}: {}", e.getMessage(), e.getPath());