Experimental feature for testing WKDCli against wkd-test-suite

This commit is contained in:
Paul Schaub 2022-03-02 18:01:12 +01:00
parent 049c14b779
commit cd3f36e26a
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
9 changed files with 159 additions and 11 deletions

View file

@ -24,6 +24,19 @@ public class WKDCLI {
public static int execute(String[] args) {
return new CommandLine(WKDCLI.class)
.setExitCodeExceptionMapper(new CommandLine.IExitCodeExceptionMapper() {
@Override
public int getExitCode(Throwable exception) {
if (exception instanceof MissingUserIdException) {
return MissingUserIdException.ERROR_CODE;
} else if (exception instanceof CertNotFetchableException) {
return CertNotFetchableException.ERROR_CODE;
}
// Others get mapped to 1
return 1;
}
})
.setCommandName("wkdcli")
.execute(args);
}