From 536d769b167050912315f428f4eee326881db6cd Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 21 May 2023 00:15:20 +0800 Subject: [PATCH] feat: reimport picocli --- .../hatter/tools/yubikeyca/YubikeyCaArgs.java | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/yubikey-ca-java/src/main/java/me/hatter/tools/yubikeyca/YubikeyCaArgs.java b/yubikey-ca-java/src/main/java/me/hatter/tools/yubikeyca/YubikeyCaArgs.java index 10b8b6c..60769c1 100644 --- a/yubikey-ca-java/src/main/java/me/hatter/tools/yubikeyca/YubikeyCaArgs.java +++ b/yubikey-ca-java/src/main/java/me/hatter/tools/yubikeyca/YubikeyCaArgs.java @@ -1,64 +1,67 @@ package me.hatter.tools.yubikeyca; -import picocli.CommandLine; +import picocli.CommandLine.Command; +import picocli.CommandLine.Option; -@CommandLine.Command(name = YubikeyCaConstant.NAME, version = YubikeyCaConstant.NAME + " v" + YubikeyCaConstant.VERSION, description = "\n" + - "Yubikey CA tool\n" + - "\n" + - "Argument details:") +@Command(name = YubikeyCaConstant.NAME, + version = YubikeyCaConstant.NAME + " v" + YubikeyCaConstant.VERSION, + description = "\n" + + "Yubikey CA tool\n" + + "\n" + + "Argument details:") public class YubikeyCaArgs { - @CommandLine.Option(names = {"--generate-keypair"}, description = "Generate keypair") + @Option(names = {"--generate-keypair"}, description = "Generate keypair") boolean generateKeypair = false; - @CommandLine.Option(names = {"--issue-root-ca"}, description = "Issue root CA") + @Option(names = {"--issue-root-ca"}, description = "Issue root CA") boolean issueRootCa = false; - @CommandLine.Option(names = {"--issue-intermediate-ca"}, description = "Issue intermediate CA") + @Option(names = {"--issue-intermediate-ca"}, description = "Issue intermediate CA") boolean issueIntermediateCa = false; - @CommandLine.Option(names = {"--issue-server-ca"}, description = "Issue server CA") + @Option(names = {"--issue-server-ca"}, description = "Issue server CA") boolean issueServerCa = false; - @CommandLine.Option(names = {"--issue-client-ca"}, description = "Issue client CA") + @Option(names = {"--issue-client-ca"}, description = "Issue client CA") boolean issueClientCa = false; - @CommandLine.Option(names = {"--subject"}, description = "Certificate subject") + @Option(names = {"--subject"}, description = "Certificate subject") String subject; - @CommandLine.Option(names = {"--root-ca-id"}, description = "Root certificate ID") + @Option(names = {"--root-ca-id"}, description = "Root certificate ID") String rootCaId; - @CommandLine.Option(names = {"--intermediate-ca-id"}, description = "Intermediate certificate ID") + @Option(names = {"--intermediate-ca-id"}, description = "Intermediate certificate ID") String intermediateCaId; - @CommandLine.Option(names = {"--dns-name"}, description = "DNS name (Subject alt name)") + @Option(names = {"--dns-name"}, description = "DNS name (Subject alt name)") String[] dnsNames; - @CommandLine.Option(names = {"--keypair-type"}, description = "Keypair type, e.g." + + @Option(names = {"--keypair-type"}, description = "Keypair type, e.g." + " RSA1024, RSA2048, RSA3072, RSA4096," + " secp192k1, secp192r1, secp224k1, secp256k1," + " secp224r1, secp256r1, secp384r1, secp521r1;") String keypairType; - @CommandLine.Option(names = {"--sign-slot"}, description = "Slot for sign") + @Option(names = {"--sign-slot"}, description = "Slot for sign") String signSlot; - @CommandLine.Option(names = {"--cert-slot"}, description = "Slot for cert") + @Option(names = {"--cert-slot"}, description = "Slot for cert") String certSlot; - @CommandLine.Option(names = {"--pin"}, description = "Yubikey PIV PIN") + @Option(names = {"--pin"}, description = "Yubikey PIV PIN") String pin; - @CommandLine.Option(names = {"--memo"}, description = "Memo") + @Option(names = {"--memo"}, description = "Memo") String memo; - @CommandLine.Option(names = {"--add-to-remote"}, description = "Add certificate to remote") + @Option(names = {"--add-to-remote"}, description = "Add certificate to remote") boolean addToRemote = false; - @CommandLine.Option(names = {"-h", "--help"}, usageHelp = true, description = "Display a help message") + @Option(names = {"-h", "--help"}, usageHelp = true, description = "Display a help message") boolean helpRequested = false; - @CommandLine.Option(names = {"-V", "--version"}, versionHelp = true, description = "Display a version message") + @Option(names = {"-V", "--version"}, versionHelp = true, description = "Display a version message") boolean versionRequested = false; }