1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-17 18:02:05 +01:00

Report PGPainless version in sop version --backend

This commit is contained in:
Paul Schaub 2023-05-08 16:01:59 +02:00
parent 1523497da4
commit 8fe3a7159d
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 7 additions and 4 deletions

View file

@ -29,7 +29,7 @@ public class VersionCmdTest extends CLITest {
public void testGetBackendVersion() throws IOException {
ByteArrayOutputStream out = pipeStdoutToStream();
assertSuccess(executeCommand("version", "--backend"));
assertTrue(out.toString().startsWith("Bouncy Castle "));
assertTrue(out.toString().startsWith("PGPainless "));
}
@Test

View file

@ -10,6 +10,9 @@ import java.util.Locale;
import java.util.Properties;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.pgpainless.PGPainless;
import org.pgpainless.implementation.ImplementationFactory;
import org.pgpainless.provider.ProviderFactory;
import sop.operation.Version;
/**
@ -45,12 +48,12 @@ public class VersionImpl implements Version {
@Override
public String getBackendVersion() {
double bcVersion = new BouncyCastleProvider().getVersion();
return String.format(Locale.US, "Bouncy Castle %.2f", bcVersion);
return "PGPainless " + getVersion();
}
@Override
public String getExtendedVersion() {
double bcVersion = new BouncyCastleProvider().getVersion();
String FORMAT_VERSION = String.format("%02d", SOP_VERSION);
return getName() + " " + getVersion() + "\n" +
"https://codeberg.org/PGPainless/pgpainless/src/branch/master/pgpainless-sop\n" +
@ -61,7 +64,7 @@ public class VersionImpl implements Version {
"Based on pgpainless-core " + getVersion() + "\n" +
"https://pgpainless.org\n" +
"\n" +
"Using " + getBackendVersion() + "\n" +
"Using " + String.format(Locale.US, "Bouncy Castle %.2f", bcVersion) + "\n" +
"https://www.bouncycastle.org/java.html";
}