From 7eb6a06db0be2d66657f51be387fdd95277e0d74 Mon Sep 17 00:00:00 2001 From: Andres Almiray Date: Wed, 22 Feb 2023 18:57:21 +0100 Subject: [PATCH] fix(cli): Print aggregated output just once --- .../java/org/kordamp/jarviz/cli/bytecode/BytecodeShow.java | 3 +-- .../java/org/kordamp/jarviz/cli/manifest/ManifestQuery.java | 3 +-- .../java/org/kordamp/jarviz/cli/manifest/ManifestShow.java | 3 +-- .../java/org/kordamp/jarviz/cli/modules/ModuleDescriptor.java | 3 +-- .../main/java/org/kordamp/jarviz/cli/modules/ModuleName.java | 3 +-- .../java/org/kordamp/jarviz/cli/packages/PackagesSplit.java | 3 +-- .../java/org/kordamp/jarviz/cli/services/ServicesList.java | 3 +-- .../java/org/kordamp/jarviz/cli/services/ServicesShow.java | 3 +-- 8 files changed, 8 insertions(+), 16 deletions(-) diff --git a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/bytecode/BytecodeShow.java b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/bytecode/BytecodeShow.java index 8837e5c..1829e05 100644 --- a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/bytecode/BytecodeShow.java +++ b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/bytecode/BytecodeShow.java @@ -71,10 +71,9 @@ private void output(Set> results) { output(result); } else { buildReport(outputFormat, root, result); - writeOutput(resolveFormatter(outputFormat).write(root)); } - if (results.size() > 1) parent().getOut().println(""); } + writeOutput(resolveFormatter(outputFormat).write(root)); } private void output(JarProcessor.JarFileResult result) { diff --git a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/manifest/ManifestQuery.java b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/manifest/ManifestQuery.java index c1efac5..ffdeff6 100644 --- a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/manifest/ManifestQuery.java +++ b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/manifest/ManifestQuery.java @@ -67,10 +67,9 @@ private void output(Set>> results) { output(result); } else { buildReport(root, result); - writeOutput(resolveFormatter(outputFormat).write(root)); } - if (results.size() > 1) parent().getOut().println(""); } + writeOutput(resolveFormatter(outputFormat).write(root)); } private void output(JarProcessor.JarFileResult> result) { diff --git a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/manifest/ManifestShow.java b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/manifest/ManifestShow.java index 5da4720..0b257eb 100644 --- a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/manifest/ManifestShow.java +++ b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/manifest/ManifestShow.java @@ -61,10 +61,9 @@ private void output(Set 1) parent().getOut().println(""); } + writeOutput(resolveFormatter(outputFormat).write(root)); } private void output(JarProcessor.JarFileResult> result) { diff --git a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/modules/ModuleDescriptor.java b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/modules/ModuleDescriptor.java index 59894d1..c9cdf83 100644 --- a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/modules/ModuleDescriptor.java +++ b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/modules/ModuleDescriptor.java @@ -65,10 +65,9 @@ private void output(Set 1) parent().getOut().println(""); } + writeOutput(resolveFormatter(outputFormat).write(root)); } private void output(JarProcessor.JarFileResult result) { diff --git a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/modules/ModuleName.java b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/modules/ModuleName.java index 6449da1..c7d9eee 100644 --- a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/modules/ModuleName.java +++ b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/modules/ModuleName.java @@ -60,10 +60,9 @@ private void output(Set 1) parent().getOut().println(""); } + writeOutput(resolveFormatter(outputFormat).write(root)); } private void output(JarProcessor.JarFileResult result) { diff --git a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/packages/PackagesSplit.java b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/packages/PackagesSplit.java index 7963d0c..cb09d12 100644 --- a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/packages/PackagesSplit.java +++ b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/packages/PackagesSplit.java @@ -53,10 +53,9 @@ private void output(Set>> results) { output(result); } else { buildReport(outputFormat, root, result); - writeOutput(resolveFormatter(outputFormat).write(root)); } - if (results.size() > 1) parent().getOut().println(""); } + writeOutput(resolveFormatter(outputFormat).write(root)); } private void output(JarProcessor.JarFileResult> result) { diff --git a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/services/ServicesList.java b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/services/ServicesList.java index 9e707ab..356d46a 100644 --- a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/services/ServicesList.java +++ b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/services/ServicesList.java @@ -60,10 +60,9 @@ private void output(Set>>> resul output(result); } else { buildReport(outputFormat, root, result); - writeOutput(resolveFormatter(outputFormat).write(root)); } - if (results.size() > 1) parent().getOut().println(""); } + writeOutput(resolveFormatter(outputFormat).write(root)); } private void output(JarProcessor.JarFileResult>> result) { diff --git a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/services/ServicesShow.java b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/services/ServicesShow.java index 6075d97..cc8cbb5 100644 --- a/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/services/ServicesShow.java +++ b/plugins/jarviz-cli/src/main/java/org/kordamp/jarviz/cli/services/ServicesShow.java @@ -64,10 +64,9 @@ private void output(Set>>> resul output(result); } else { buildReport(outputFormat, root, result); - writeOutput(resolveFormatter(outputFormat).write(root)); } - if (results.size() > 1) parent().getOut().println(""); } + writeOutput(resolveFormatter(outputFormat).write(root)); } private void output(JarProcessor.JarFileResult>> result) {