package cz.hobrasoft.pdfmu;

import net.sourceforge.argparse4j.inf.Subparser;
import net.sourceforge.argparse4j.inf.Subparsers;

/**
 * Adds a digital signature to a PDF document
 * 
 * @author Filip
 */
public class CommandSign implements Command {

    @Override
    public void execute(String[] args) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Subparser addParser(Subparsers subparsers) {
        String help = "Digitally sign a PDF document";
        
        Subparser subparser = subparsers.addParser("sign")
                .help(help)
                .description(help)
                .defaultHelp(true)
                .setDefault("command", CommandSign.class);
        
        return subparser;
    }
    
}

@@ -22,16 +22,66 @@
 pdfmu;%0A%0A
+import net.sourceforge.argparse4j.impl.Arguments;%0A
 import n
@@ -121,16 +121,16 @@
 parser;%0A
-
 import n
@@ -552,16 +552,143 @@
 ument%22;%0A
+        String metavarIn = %22IN.pdf%22;%0A        String metavarOut = %22OUT.pdf%22;%0A        String metavarCertificate = %22CERTIFICATE%22;%0A
         
@@ -845,16 +845,16 @@
 p(true)%0A
-
         
@@ -904,16 +904,881 @@
 class);%0A
+        subparser.addArgument(%22-i%22, %22--in%22)%0A                .help(%22input PDF file%22)%0A                .type(String.class)%0A                .required(true)%0A                .nargs(%22?%22)%0A                .metavar(metavarIn);%0A        subparser.addArgument(%22-c%22, %22--certificate%22)%0A                .help(%22certificate file to sign with%22)%0A                .type(String.class)%0A                .required(true)%0A                .nargs(%22?%22)%0A                .metavar(metavarCertificate);%0A        subparser.addArgument(%22-o%22, %22--out%22)%0A                .help(%22output PDF file%22)%0A                .type(String.class)%0A                .nargs(%22?%22)%0A                .metavar(metavarOut);%0A        subparser.addArgument(%22--force%22)%0A                .help(String.format(%22overwrite %25s if already present%22, metavarOut))%0A                .type(boolean.class)%0A                .action(Arguments.storeTrue());%0A
         

Add parser arguments