Skip to content

Commit

Permalink
add show version to command line args
Browse files Browse the repository at this point in the history
  • Loading branch information
craigraw committed Oct 27, 2022
1 parent dd9868c commit e7f6f7f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/sparrowwallet/sparrow/Args.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/sparrowwallet/sparrow/SparrowWallet.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public static void main(String[] argv) {
System.exit(0);
}

if(args.version) {
System.out.println("Sparrow Wallet " + APP_VERSION);
System.exit(0);
}

if(args.level != null) {
Drongo.setRootLogLevel(args.level);
}
Expand Down

0 comments on commit e7f6f7f

Please sign in to comment.