Skip to content

Commit

Permalink
✨ Merge pull request #20 from srlearn/version-cli
Browse files Browse the repository at this point in the history
✨ Add `-v`/`-version` command-line argument
  • Loading branch information
hayesall authored Jun 3, 2022
2 parents 13b7d39 + d3ca404 commit 051d4ce
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public CommandLineArguments() {
* 5. Define a usage string in getUsageString
*/

public static final String srlboost_version = "0.1.1";

private static final String argPrefix = "-";
private static final String learn = "l";

Expand Down Expand Up @@ -165,6 +167,11 @@ public boolean parseArgs(String[] args) {
if (args[i].trim().isEmpty())
continue;

if (argMatches(args[i], "v") || argMatches(args[i], "version")) {
System.out.println(srlboost_version);
System.exit(0);
}

if (argMatches(args[i], "h") || argMatches(args[i], "help")) {
System.out.println(getUsageString());
System.exit(0);
Expand Down

0 comments on commit 051d4ce

Please sign in to comment.