From ce2342008a17abd652eb62aa2b4d20e7295a62a7 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Thu, 9 Dec 2021 12:46:37 +0100 Subject: [PATCH] Removed end blank line in version display. --- .../statoolinfos/cli/StatoolInfosCLI.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/fr/devinsy/statoolinfos/cli/StatoolInfosCLI.java b/src/fr/devinsy/statoolinfos/cli/StatoolInfosCLI.java index 1a9d42a..6be4bbb 100644 --- a/src/fr/devinsy/statoolinfos/cli/StatoolInfosCLI.java +++ b/src/fr/devinsy/statoolinfos/cli/StatoolInfosCLI.java @@ -133,7 +133,7 @@ public final class StatoolInfosCLI message.appendln(BuildInformation.instance().version()); - System.out.println(message.toString()); + System.out.print(message.toString()); } /** @@ -387,6 +387,20 @@ public final class StatoolInfosCLI { File configurationFile = new File(StringUtils.trim(args[1])); + try + { + StatoolInfos.probe(configurationFile); + } + catch (Exception exception) + { + logger.error("Error with [{}]: {}", configurationFile.getAbsoluteFile(), exception.getMessage()); + exception.printStackTrace(); + } + } + else if (isMatching(args, "probe", "\\s*.+/\\s*")) + { + File configurationFile = new File(StringUtils.trim(args[1])); + if (configurationFile.isDirectory()) { Files inputs = FilesUtils.searchEndingWith(configurationFile, ".conf"); @@ -405,15 +419,7 @@ public final class StatoolInfosCLI } else { - try - { - StatoolInfos.probe(configurationFile); - } - catch (Exception exception) - { - logger.error("Error with [{}]: {}", configurationFile.getAbsoluteFile(), exception.getMessage()); - exception.printStackTrace(); - } + System.out.println("Parameter is not a directory."); } } else if (isMatching(args, "stat", "ip", "\\s*\\S+\\s*"))