From e7f6f7f3db68519852fe17b1c716492b71cb5c85 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 27 Oct 2022 11:49:20 +0200 Subject: [PATCH] add show version to command line args --- src/main/java/com/sparrowwallet/sparrow/Args.java | 3 +++ src/main/java/com/sparrowwallet/sparrow/SparrowWallet.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/Args.java b/src/main/java/com/sparrowwallet/sparrow/Args.java index 93a3d423..3c885358 100644 --- a/src/main/java/com/sparrowwallet/sparrow/Args.java +++ b/src/main/java/com/sparrowwallet/sparrow/Args.java @@ -20,6 +20,9 @@ public class Args { @Parameter(names = { "--terminal", "-t" }, description = "Terminal mode", arity = 0) public boolean terminal; + @Parameter(names = { "--version", "-v" }, description = "Show version", arity = 0) + public boolean version; + @Parameter(names = { "--help", "-h" }, description = "Show usage", help = true) public boolean help; diff --git a/src/main/java/com/sparrowwallet/sparrow/SparrowWallet.java b/src/main/java/com/sparrowwallet/sparrow/SparrowWallet.java index 59324ab6..e01f0880 100644 --- a/src/main/java/com/sparrowwallet/sparrow/SparrowWallet.java +++ b/src/main/java/com/sparrowwallet/sparrow/SparrowWallet.java @@ -34,6 +34,11 @@ public class SparrowWallet { System.exit(0); } + if(args.version) { + System.out.println("Sparrow Wallet " + APP_VERSION); + System.exit(0); + } + if(args.level != null) { Drongo.setRootLogLevel(args.level); }