You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ms...@apache.org on 2020/12/28 16:49:09 UTC

svn commit: r1884885 - in /pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools: ImportFDF.java ImportXFDF.java

Author: msahyoun
Date: Mon Dec 28 16:49:08 2020
New Revision: 1884885

URL: http://svn.apache.org/viewvc?rev=1884885&view=rev
Log:
PDFBOX-2602: use options instead of parameters as suggested by clig.dev

Modified:
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ImportFDF.java
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ImportXFDF.java

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ImportFDF.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ImportFDF.java?rev=1884885&r1=1884884&r2=1884885&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ImportFDF.java (original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ImportFDF.java Mon Dec 28 16:49:08 2020
@@ -29,7 +29,7 @@ import org.apache.pdfbox.pdmodel.interac
 
 import picocli.CommandLine;
 import picocli.CommandLine.Command;
-import picocli.CommandLine.Parameters;
+import picocli.CommandLine.Option;
 
 /**
  * This example will take a PDF document and fill the fields with data from the
@@ -43,15 +43,15 @@ public class ImportFDF implements Callab
     // Expected for CLI app to write to System.out/Sytem.err
     @SuppressWarnings("squid:S106")
     private static final PrintStream SYSERR = System.err;
-
-    @Parameters(paramLabel = "pdffile", index = "0", arity = "1", description = "the PDF file to import to.")
+    
+    @Option(names = {"-i", "--input"}, description = "the PDF file to import to", required = true)
     private File infile;
 
-    @Parameters(paramLabel = "fdffile", index = "1", arity = "1", description = "the FDF data file to import from.")
-    private File fdffile;
-
-    @Parameters(paramLabel = "outputfile", index = "2", arity = "0..1", description = "the PDF file to save to. If omitted the orginal PDF will be used.")
+    @Option(names = {"-o", "--output"}, description = "the PDF file to save to. If omitted the original file will be used")
     private File outfile;
+
+    @Option(names = {"--data"}, description = "the FDF data file to import from", required = true)
+    private File fdffile;
     /**
      * This will takes the values from the fdf document and import them into the
      * PDF document.

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ImportXFDF.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ImportXFDF.java?rev=1884885&r1=1884884&r2=1884885&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ImportXFDF.java (original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ImportXFDF.java Mon Dec 28 16:49:08 2020
@@ -24,7 +24,7 @@ import org.apache.pdfbox.pdmodel.interac
 
 import picocli.CommandLine;
 import picocli.CommandLine.Command;
-import picocli.CommandLine.Parameters;
+import picocli.CommandLine.Option;
 
 import java.io.File;
 import java.io.IOException;
@@ -44,15 +44,15 @@ public class ImportXFDF
     @SuppressWarnings("squid:S106")
     private static final PrintStream SYSERR = System.err;
 
-    @Parameters(paramLabel = "pdffile", index = "0", arity = "1", description = "the PDF file to import to.")
+    @Option(names = {"-i", "--input"}, description = "the PDF file to import to", required = true)
     private File infile;
 
-    @Parameters(paramLabel = "xfdffile", index = "1", arity = "1", description = "the XFDF data file to import from.")
-    private File xfdffile;
-
-    @Parameters(paramLabel = "outputfile", index = "2", arity = "0..1", description = "the PDF file to save to. If omitted the orginal PDF will be used.")
+    @Option(names = {"-o", "--output"}, description = "the PDF file to save to. If omitted the original file will be used")
     private File outfile;
 
+    @Option(names = {"--data"}, description = "the XFDF data file to import from", required = true)
+    private File xfdffile;
+
     /**
      * This will takes the values from the fdf document and import them into the
      * PDF document.