Skip to content

Commit

Permalink
Add '-version' as command line option (#427)
Browse files Browse the repository at this point in the history
* Add '-version' as command line option

* Print version via System.out for better formatting

* Add '-v' option for version
  • Loading branch information
rit-clone authored Dec 10, 2022
1 parent aa28271 commit 1ef840a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dbms/src/main/java/org/polypheny/db/PolyphenyDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ public class PolyphenyDb {
@Option(name = { "-c", "--config" }, description = "Path to the configuration file", type = OptionType.GLOBAL)
protected String applicationConfPath;

@Option(name = {"-v", "--version"}, description = "Current version of Polypheny-DB")
public boolean versionOptionEnabled = false;

// required for unit tests to determine when the system is ready to process queries
@Getter
private volatile boolean isReady = false;
Expand All @@ -142,6 +145,11 @@ public static void main( final String[] args ) {
return;
}

if ( polyphenyDb.versionOptionEnabled ) {
System.out.println("v" + polyphenyDb.getClass().getPackage().getImplementationVersion());
return;
}

polyphenyDb.runPolyphenyDb();
} catch ( Throwable uncaught ) {
if ( log.isErrorEnabled() ) {
Expand Down

0 comments on commit 1ef840a

Please sign in to comment.