Skip to content
Snippets Groups Projects
Commit e9870adf authored by Sebastian's avatar Sebastian Committed by Torsten Grote
Browse files

Add --version switch to command line

parent 1af6c8ee
No related branches found
No related tags found
1 merge request!358Add --version switch to command line
Pipeline #15264 passed
...@@ -50,6 +50,7 @@ import java.time.format.DateTimeFormatter ...@@ -50,6 +50,7 @@ import java.time.format.DateTimeFormatter
import java.util.logging.Level.ALL import java.util.logging.Level.ALL
import java.util.logging.Level.INFO import java.util.logging.Level.INFO
import java.util.logging.Level.WARNING import java.util.logging.Level.WARNING
import kotlin.system.exitProcess
@NonNls @NonNls
private val DEFAULT_DATA_DIR = getProperty("user.home") + separator + ".briar" + separator + "desktop" private val DEFAULT_DATA_DIR = getProperty("user.home") + separator + ".briar" + separator + "desktop"
...@@ -63,6 +64,10 @@ private class Main : CliktCommand( ...@@ -63,6 +64,10 @@ private class Main : CliktCommand(
private val LOG = KotlinLogging.logger {} 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( private val debug by option(
"--debug", "-d", // NON-NLS "--debug", "-d", // NON-NLS
help = i18n("main.help.debug") help = i18n("main.help.debug")
...@@ -110,6 +115,8 @@ private class Main : CliktCommand( ...@@ -110,6 +115,8 @@ private class Main : CliktCommand(
if (BuildData.GIT_BRANCH == null && BuildData.GIT_TAG == null) if (BuildData.GIT_BRANCH == null && BuildData.GIT_TAG == null)
LOG.i { " Neither branch nor tag detected" } LOG.i { " Neither branch nor tag detected" }
if (version) exitProcess(0)
val dataDir = getDataDir() val dataDir = getDataDir()
val app = val app =
DaggerBriarDesktopApp.builder().desktopCoreModule( DaggerBriarDesktopApp.builder().desktopCoreModule(
......
...@@ -303,6 +303,7 @@ peer.trust.stranger=Stranger ...@@ -303,6 +303,7 @@ peer.trust.stranger=Stranger
# Main # Main
main.help.title=Briar Desktop Client main.help.title=Briar Desktop Client
main.help.version=Print version and exit
main.help.debug=Enable printing of debug messages main.help.debug=Enable printing of debug messages
main.help.verbose=Print verbose log messages main.help.verbose=Print verbose log messages
main.help.data=The directory where Briar will store its files. Default: {0} main.help.data=The directory where Briar will store its files. Default: {0}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment