summaryrefslogtreecommitdiffstats
path: root/base/java-tools/src/com/netscape/cmstools
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-09-25 00:43:31 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-09-28 09:42:24 -0500
commit9368ef42cea4e1e46f22628cffaa29fba66cfec6 (patch)
treecef737e524f9d19f919a5f3e260cc4bad6b35121 /base/java-tools/src/com/netscape/cmstools
parent854ecce0fc312e65804d84041cbc93b17cce88a5 (diff)
downloadpki-9368ef42cea4e1e46f22628cffaa29fba66cfec6.tar.gz
pki-9368ef42cea4e1e46f22628cffaa29fba66cfec6.tar.xz
pki-9368ef42cea4e1e46f22628cffaa29fba66cfec6.zip
Added VERSION file.
The CMake scripts have been modified to store the version number in /usr/share/pki/VERSION and in JAR manifest files. These files can be read by PKI applications to obtain the version number without having to query the RPM database. Fixed warnings in Java.cmake file. Ticket #339
Diffstat (limited to 'base/java-tools/src/com/netscape/cmstools')
-rw-r--r--base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java b/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java
index a6350e5d8..44ccf9511 100644
--- a/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java
@@ -50,6 +50,11 @@ public class MainCLI extends CLI {
addModule(new UserCLI(this));
}
+ public void printVersion() {
+ Package pkg = MainCLI.class.getPackage();
+ System.out.println("PKI Command-Line Interface "+pkg.getImplementationVersion());
+ }
+
public void printHelp() {
formatter.printHelp(name+" [OPTIONS..] <command> [ARGS..]", options);
@@ -118,6 +123,7 @@ public class MainCLI extends CLI {
options.addOption("v", false, "Verbose");
options.addOption(null, "help", false, "Help");
+ options.addOption(null, "version", false, "Version");
}
public void parseOptions(CommandLine cmd) throws URISyntaxException {
@@ -170,6 +176,11 @@ public class MainCLI extends CLI {
String[] cmdArgs = cmd.getArgs();
+ if (cmd.hasOption("version")) {
+ printVersion();
+ System.exit(1);
+ }
+
if (cmdArgs.length == 0 || cmd.hasOption("help")) {
printHelp();
System.exit(1);