#9 -v CLI flag for querying the installed Checkstyle version
This commit is contained in:
parent
cf38b070cc
commit
f85edb7127
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue