add show version to command line args

This commit is contained in:
Craig Raw 2022-10-27 11:49:20 +02:00
parent dd9868c918
commit e7f6f7f3db
2 changed files with 8 additions and 0 deletions

View file

@ -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;

View file

@ -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);
}