Working native image

This commit is contained in:
Paul Schaub 2024-12-12 19:22:46 +01:00
parent cc4870219a
commit 0123b0e5fe
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
12 changed files with 254 additions and 41 deletions

View file

@ -1,14 +1,27 @@
package org.pgpainless;
import org.pgpainless.bouncycastle.sop.BouncyCastleSOP;
import picocli.CommandLine;
import sop.cli.picocli.SOPExceptionExitCodeMapper;
import sop.cli.picocli.SOPExecutionExceptionHandler;
import sop.cli.picocli.SopCLI;
public class BcSopCLI {
public class BcSopCLI extends SopCLI {
public static void main(String[] args) {
SopCLI.EXECUTABLE_NAME = "bc-sop";
SopCLI.setSopInstance(new BouncyCastleSOP());
int exitCode = SopCLI.execute(args);
System.exit(exitCode);
System.exit(run(args));
}
public static int run(String[] args)
{
CommandLine cmd = new CommandLine(SopCLI.class);
cmd.getSubcommands().get("generate-completion").getCommandSpec().usageMessage().hidden(true);
cmd.setCommandName("bcsop");
cmd.setExecutionExceptionHandler(new SOPExecutionExceptionHandler());
cmd.setExitCodeExceptionMapper(new SOPExceptionExitCodeMapper());
cmd.setCaseInsensitiveEnumValuesAllowed(true);
return cmd.execute(args);
}
}