#9 -v CLI flag for querying the installed Checkstyle version

This commit is contained in:
ychulovskyy 2014-11-21 20:52:15 +01:00
parent cf38b070cc
commit f85edb7127
1 changed files with 7 additions and 0 deletions

View File

@ -56,6 +56,7 @@ public final class Main
"f",
true,
"Sets the output format. (plain|xml). Defaults to plain");
OPTS.addOption("v", false, "Print product version and exit");
}
/** Stop instances being created. */
@ -82,6 +83,12 @@ public final class Main
}
assert line != null;
// show version and exit
if (line.hasOption("v")) {
System.out.println("Checkstyle version: " + Main.class.getPackage().getImplementationVersion());
System.exit(0);
}
// setup the properties
final Properties props =
line.hasOption("p")