any23-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hansbre...@apache.org
Subject [2/6] any23 git commit: ANY23-356 updated jcommander and refactored code accordingly
Date Thu, 05 Jul 2018 21:25:39 GMT
ANY23-356 updated jcommander and refactored code accordingly


Project: http://git-wip-us.apache.org/repos/asf/any23/repo
Commit: http://git-wip-us.apache.org/repos/asf/any23/commit/1d5e0ecb
Tree: http://git-wip-us.apache.org/repos/asf/any23/tree/1d5e0ecb
Diff: http://git-wip-us.apache.org/repos/asf/any23/diff/1d5e0ecb

Branch: refs/heads/master
Commit: 1d5e0ecbee57ea8540411ac7ac79b6f44cd9c5db
Parents: 61de804
Author: Hans <firedrake93@gmail.com>
Authored: Mon Jul 2 12:45:39 2018 -0500
Committer: Hans <firedrake93@gmail.com>
Committed: Mon Jul 2 18:24:38 2018 -0500

----------------------------------------------------------------------
 .../any23/cli/ExtractorDocumentation.java       | 27 +++++---------------
 pom.xml                                         |  2 +-
 2 files changed, 8 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/any23/blob/1d5e0ecb/cli/src/main/java/org/apache/any23/cli/ExtractorDocumentation.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/any23/cli/ExtractorDocumentation.java b/cli/src/main/java/org/apache/any23/cli/ExtractorDocumentation.java
index 9a0410b..f0fbeea 100644
--- a/cli/src/main/java/org/apache/any23/cli/ExtractorDocumentation.java
+++ b/cli/src/main/java/org/apache/any23/cli/ExtractorDocumentation.java
@@ -30,8 +30,6 @@ import org.apache.any23.extractor.ExtractorFactory;
 import org.apache.any23.extractor.ExtractorRegistry;
 
 import java.io.IOException;
-import java.util.LinkedList;
-import java.util.List;
 
 /**
  * This class provides some command-line documentation
@@ -44,32 +42,21 @@ public class ExtractorDocumentation implements Tool {
     private boolean showList;
 
     @Parameter( names = { "-i", "--input" }, description = "shows example input for the given
extractor" )
-    private boolean showInput;
+    private String input;
 
-    @Parameter( names = { "-o", "--outut" }, description = "shows example output for the
given extractor" )
-    private boolean showOutput;
+    @Parameter( names = { "-o", "--output" }, description = "shows example output for the
given extractor" )
+    private String output;
 
     @Parameter( names = { "-a", "--all" }, description = "shows a report about all available
extractors" )
     private boolean showAll;
 
-    @Parameter( arity = 1, description = "Extractor name" )
-    private List<String> extractor = new LinkedList<String>();
-
     public void run() throws Exception {
         if (showList) {
             printExtractorList(ExtractorRegistryImpl.getInstance());
-        } else if (showInput) {
-            if (extractor.isEmpty()) {
-                throw new IllegalArgumentException("Required argument for -i: extractor name");
-            }
-
-            printExampleInput(extractor.get(0), ExtractorRegistryImpl.getInstance());
-        } else if (showOutput) {
-            if (extractor.isEmpty()) {
-                throw new IllegalArgumentException("Required argument for -o: extractor name");
-            }
-
-            printExampleOutput(extractor.get(0), ExtractorRegistryImpl.getInstance());
+        } else if (input != null) {
+            printExampleInput(input, ExtractorRegistryImpl.getInstance());
+        } else if (output != null) {
+            printExampleOutput(output, ExtractorRegistryImpl.getInstance());
         } else if (showAll) {
             printReport(ExtractorRegistryImpl.getInstance());
         }

http://git-wip-us.apache.org/repos/asf/any23/blob/1d5e0ecb/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 29f44cc..8d3d408 100644
--- a/pom.xml
+++ b/pom.xml
@@ -565,7 +565,7 @@
       <dependency>
         <groupId>com.beust</groupId>
         <artifactId>jcommander</artifactId>
-        <version>1.30</version>
+        <version>1.72</version>
       </dependency>
 
       <!-- BEGIN: logger -->


Mime
View raw message