diff --git a/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/Main.kt b/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/Main.kt index f0eb6e3fe2b496e2b72d9e6705be0a517ed228b9..11bd96ef9e23d81094f14ed89a640ca80b979d20 100644 --- a/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/Main.kt +++ b/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/Main.kt @@ -50,6 +50,7 @@ import java.time.format.DateTimeFormatter import java.util.logging.Level.ALL import java.util.logging.Level.INFO import java.util.logging.Level.WARNING +import kotlin.system.exitProcess @NonNls private val DEFAULT_DATA_DIR = getProperty("user.home") + separator + ".briar" + separator + "desktop" @@ -63,6 +64,10 @@ private class Main : CliktCommand( private val LOG = KotlinLogging.logger {} } + private val version by option( + "--version", // NON-NLS + help = i18n("main.help.version") + ).flag(default = false) private val debug by option( "--debug", "-d", // NON-NLS help = i18n("main.help.debug") @@ -110,6 +115,8 @@ private class Main : CliktCommand( if (BuildData.GIT_BRANCH == null && BuildData.GIT_TAG == null) LOG.i { " Neither branch nor tag detected" } + if (version) exitProcess(0) + val dataDir = getDataDir() val app = DaggerBriarDesktopApp.builder().desktopCoreModule( diff --git a/briar-desktop/src/main/resources/strings/BriarDesktop.properties b/briar-desktop/src/main/resources/strings/BriarDesktop.properties index 2351baaed2d3abb89d9202e8bfc8814fd7b0fde6..76edac5b197bba5effa6b36c311dc9e1fe06da23 100644 --- a/briar-desktop/src/main/resources/strings/BriarDesktop.properties +++ b/briar-desktop/src/main/resources/strings/BriarDesktop.properties @@ -303,6 +303,7 @@ peer.trust.stranger=Stranger # Main main.help.title=Briar Desktop Client +main.help.version=Print version and exit main.help.debug=Enable printing of debug messages main.help.verbose=Print verbose log messages main.help.data=The directory where Briar will store its files. Default: {0}