From 1dcdbc9fe9e3ad2fe232ad3baa76d186817532a4 Mon Sep 17 00:00:00 2001 From: Lucaskyy Date: Wed, 22 Jun 2022 16:51:29 +0200 Subject: [PATCH] fix: show actual version in CLI --- .../kotlin/app/revanced/cli/command/MainCommand.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/cli/command/MainCommand.kt b/src/main/kotlin/app/revanced/cli/command/MainCommand.kt index f011fe3..8ef569d 100644 --- a/src/main/kotlin/app/revanced/cli/command/MainCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/MainCommand.kt @@ -13,8 +13,16 @@ import picocli.CommandLine.* import java.io.File import java.nio.file.Files +private class CLIVersionProvider : IVersionProvider { + override fun getVersion() = arrayOf( + MainCommand::class.java.`package`.implementationVersion ?: "unknown" + ) +} + @Command( - name = "ReVanced-CLI", version = ["1.0.0"], mixinStandardHelpOptions = true + name = "ReVanced-CLI", + mixinStandardHelpOptions = true, + versionProvider = CLIVersionProvider::class ) internal object MainCommand : Runnable { @ArgGroup(exclusive = false, multiplicity = "1")