From 5281fcf2a7509f7ce86ad792da2a4dd67feebd2d Mon Sep 17 00:00:00 2001
From: Matthew Harmsen <mharmsen@redhat.com>
Date: Wed, 16 Apr 2014 18:38:10 -0700
Subject: [PATCH] CLI argument parsing and bad return codes

* PKI TRAC Ticket #843 - Incorrect CLI argument parsing
* PKI TRAC Ticket #918 - CLI commands does not return code '1' for the failures
---
 base/java-tools/bin/pki                                   |  3 ++-
 .../src/com/netscape/cmstools/cert/CertFindCLI.java       |  6 ++----
 .../src/com/netscape/cmstools/cert/CertHoldCLI.java       |  6 ++++++
 .../com/netscape/cmstools/cert/CertReleaseHoldCLI.java    |  6 ++++++
 .../com/netscape/cmstools/cert/CertRequestFindCLI.java    |  6 ++----
 .../netscape/cmstools/cert/CertRequestProfileFindCLI.java |  6 ++++++
 .../netscape/cmstools/cert/CertRequestProfileShowCLI.java |  6 ++++++
 .../com/netscape/cmstools/cert/CertRequestReviewCLI.java  |  6 ++++++
 .../com/netscape/cmstools/cert/CertRequestShowCLI.java    |  6 ++++++
 .../com/netscape/cmstools/cert/CertRequestSubmitCLI.java  |  6 ++++++
 .../src/com/netscape/cmstools/cert/CertRevokeCLI.java     |  6 ++++++
 .../src/com/netscape/cmstools/cert/CertShowCLI.java       |  6 ++++++
 base/java-tools/src/com/netscape/cmstools/cli/CLI.java    |  8 ++++++--
 .../java-tools/src/com/netscape/cmstools/cli/MainCLI.java |  5 +++--
 .../com/netscape/cmstools/client/ClientCertFindCLI.java   |  6 ++++++
 .../com/netscape/cmstools/client/ClientCertImportCLI.java |  6 ++++++
 .../com/netscape/cmstools/client/ClientCertRemoveCLI.java |  6 ++++++
 .../src/com/netscape/cmstools/client/ClientInitCLI.java   |  6 ++++++
 .../src/com/netscape/cmstools/group/GroupAddCLI.java      |  9 +++++++++
 .../src/com/netscape/cmstools/group/GroupFindCLI.java     |  6 ++++++
 .../com/netscape/cmstools/group/GroupMemberAddCLI.java    |  9 +++++++++
 .../com/netscape/cmstools/group/GroupMemberFindCLI.java   | 14 ++++++++++++++
 .../com/netscape/cmstools/group/GroupMemberRemoveCLI.java |  9 +++++++++
 .../com/netscape/cmstools/group/GroupMemberShowCLI.java   |  9 +++++++++
 .../src/com/netscape/cmstools/group/GroupModifyCLI.java   |  6 ++++++
 .../src/com/netscape/cmstools/group/GroupRemoveCLI.java   |  9 +++++++++
 .../src/com/netscape/cmstools/group/GroupShowCLI.java     |  9 +++++++++
 .../src/com/netscape/cmstools/key/KeyArchiveCLI.java      |  5 ++++-
 .../src/com/netscape/cmstools/key/KeyFindCLI.java         |  4 +++-
 .../src/com/netscape/cmstools/key/KeyGenerateCLI.java     | 13 ++++++++-----
 .../src/com/netscape/cmstools/key/KeyModifyCLI.java       | 14 +++++++++-----
 .../src/com/netscape/cmstools/key/KeyRecoverCLI.java      |  4 +++-
 .../src/com/netscape/cmstools/key/KeyRequestFindCLI.java  |  3 ++-
 .../com/netscape/cmstools/key/KeyRequestReviewCLI.java    | 15 ++++++++++-----
 .../src/com/netscape/cmstools/key/KeyRequestShowCLI.java  | 13 +++++++++----
 .../src/com/netscape/cmstools/key/KeyRetrieveCLI.java     |  4 +++-
 .../src/com/netscape/cmstools/key/KeyShowCLI.java         | 13 +++++++++----
 .../src/com/netscape/cmstools/key/KeyTemplateFindCLI.java |  4 +++-
 .../src/com/netscape/cmstools/key/KeyTemplateShowCLI.java | 13 ++++++++-----
 .../com/netscape/cmstools/logging/ActivityFindCLI.java    |  6 ++++++
 .../com/netscape/cmstools/logging/ActivityShowCLI.java    |  9 +++++++++
 .../src/com/netscape/cmstools/logging/AuditModifyCLI.java |  9 +++++++++
 .../src/com/netscape/cmstools/logging/AuditShowCLI.java   |  6 ++++++
 .../src/com/netscape/cmstools/profile/ProfileAddCLI.java  |  6 ++++++
 .../com/netscape/cmstools/profile/ProfileDisableCLI.java  |  9 +++++++++
 .../com/netscape/cmstools/profile/ProfileEnableCLI.java   |  9 +++++++++
 .../src/com/netscape/cmstools/profile/ProfileFindCLI.java |  6 ++++++
 .../com/netscape/cmstools/profile/ProfileModifyCLI.java   |  6 ++++++
 .../com/netscape/cmstools/profile/ProfileRemoveCLI.java   |  9 +++++++++
 .../src/com/netscape/cmstools/profile/ProfileShowCLI.java |  6 ++++++
 .../com/netscape/cmstools/selftests/SelfTestFindCLI.java  |  6 ++++++
 .../com/netscape/cmstools/selftests/SelfTestRunCLI.java   |  6 ++++++
 .../com/netscape/cmstools/selftests/SelfTestShowCLI.java  |  6 ++++++
 .../com/netscape/cmstools/system/KRAConnectorAddCLI.java  |  6 ++++++
 .../netscape/cmstools/system/KRAConnectorRemoveCLI.java   |  9 +++++++++
 .../cmstools/system/SecurityDomainGetInstallTokenCLI.java |  8 ++++++++
 .../netscape/cmstools/system/SecurityDomainShowCLI.java   |  6 ++++++
 .../com/netscape/cmstools/system/TPSConnectorAddCLI.java  |  6 ++++++
 .../com/netscape/cmstools/system/TPSConnectorFindCLI.java |  6 ++++++
 .../com/netscape/cmstools/system/TPSConnectorModCLI.java  |  6 ++++++
 .../netscape/cmstools/system/TPSConnectorRemoveCLI.java   |  6 ++++++
 .../com/netscape/cmstools/system/TPSConnectorShowCLI.java |  9 +++++++++
 .../cmstools/tps/authenticator/AuthenticatorAddCLI.java   |  8 ++++++++
 .../cmstools/tps/authenticator/AuthenticatorFindCLI.java  |  6 ++++++
 .../tps/authenticator/AuthenticatorModifyCLI.java         |  6 ++++++
 .../tps/authenticator/AuthenticatorRemoveCLI.java         |  9 +++++++++
 .../cmstools/tps/authenticator/AuthenticatorShowCLI.java  |  6 ++++++
 .../com/netscape/cmstools/tps/cert/TPSCertFindCLI.java    |  6 ++++++
 .../com/netscape/cmstools/tps/cert/TPSCertShowCLI.java    |  9 +++++++++
 .../com/netscape/cmstools/tps/config/ConfigModifyCLI.java |  8 ++++++++
 .../com/netscape/cmstools/tps/config/ConfigShowCLI.java   |  6 ++++++
 .../cmstools/tps/connection/ConnectionAddCLI.java         |  8 ++++++++
 .../cmstools/tps/connection/ConnectionFindCLI.java        |  6 ++++++
 .../cmstools/tps/connection/ConnectionModifyCLI.java      |  6 ++++++
 .../cmstools/tps/connection/ConnectionRemoveCLI.java      |  9 +++++++++
 .../cmstools/tps/connection/ConnectionShowCLI.java        |  6 ++++++
 .../com/netscape/cmstools/tps/profile/ProfileAddCLI.java  |  8 ++++++++
 .../com/netscape/cmstools/tps/profile/ProfileFindCLI.java |  6 ++++++
 .../cmstools/tps/profile/ProfileMappingAddCLI.java        |  8 ++++++++
 .../cmstools/tps/profile/ProfileMappingFindCLI.java       |  6 ++++++
 .../cmstools/tps/profile/ProfileMappingModifyCLI.java     |  6 ++++++
 .../cmstools/tps/profile/ProfileMappingRemoveCLI.java     |  9 +++++++++
 .../cmstools/tps/profile/ProfileMappingShowCLI.java       |  6 ++++++
 .../netscape/cmstools/tps/profile/ProfileModifyCLI.java   |  6 ++++++
 .../netscape/cmstools/tps/profile/ProfileRemoveCLI.java   |  9 +++++++++
 .../com/netscape/cmstools/tps/profile/ProfileShowCLI.java |  6 ++++++
 .../src/com/netscape/cmstools/tps/token/TokenAddCLI.java  |  9 +++++++++
 .../src/com/netscape/cmstools/tps/token/TokenFindCLI.java |  6 ++++++
 .../com/netscape/cmstools/tps/token/TokenModifyCLI.java   |  9 +++++++++
 .../com/netscape/cmstools/tps/token/TokenRemoveCLI.java   |  9 +++++++++
 .../src/com/netscape/cmstools/tps/token/TokenShowCLI.java |  9 +++++++++
 .../src/com/netscape/cmstools/user/UserAddCLI.java        |  9 +++++++++
 .../src/com/netscape/cmstools/user/UserCertAddCLI.java    |  8 ++++++++
 .../src/com/netscape/cmstools/user/UserCertFindCLI.java   | 14 ++++++++++++++
 .../src/com/netscape/cmstools/user/UserCertRemoveCLI.java |  8 ++++++++
 .../src/com/netscape/cmstools/user/UserCertShowCLI.java   | 14 ++++++++++++++
 .../src/com/netscape/cmstools/user/UserFindCLI.java       |  6 ++++++
 .../com/netscape/cmstools/user/UserMembershipAddCLI.java  |  9 +++++++++
 .../com/netscape/cmstools/user/UserMembershipFindCLI.java | 14 ++++++++++++++
 .../netscape/cmstools/user/UserMembershipRemoveCLI.java   |  9 +++++++++
 .../src/com/netscape/cmstools/user/UserModifyCLI.java     |  6 ++++++
 .../src/com/netscape/cmstools/user/UserRemoveCLI.java     |  9 +++++++++
 .../src/com/netscape/cmstools/user/UserShowCLI.java       |  9 +++++++++
 103 files changed, 731 insertions(+), 47 deletions(-)

diff --git a/base/java-tools/bin/pki b/base/java-tools/bin/pki
index 64438b5..a9f9e5c 100644
--- a/base/java-tools/bin/pki
+++ b/base/java-tools/bin/pki
@@ -110,7 +110,8 @@ def run_java_cli(args):
 
     command.extend(args)
 
-    subprocess.call(command)
+    rv = subprocess.call(command)
+    exit(rv)
 
 
 def run_python_cli(args):
diff --git a/base/java-tools/src/com/netscape/cmstools/cert/CertFindCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertFindCLI.java
index 97a76d7..333a3da 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertFindCLI.java
@@ -67,8 +67,9 @@ public class CertFindCLI extends CLI {
         }
 
         if (cmd.hasOption("help")) {
+            // Display usage
             printHelp();
-            System.exit(1);
+            System.exit(0);
         }
 
         String fileName = null;
@@ -152,9 +153,6 @@ public class CertFindCLI extends CLI {
         option.setArgName("size");
         options.addOption(option);
 
-        //help
-        options.addOption(null, "help", false, "Show help options");
-
         //file input
         option = new Option(null, "input", true, "File containing the search constraints");
         option.setArgName("file path");
diff --git a/base/java-tools/src/com/netscape/cmstools/cert/CertHoldCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertHoldCLI.java
index 2ebdb0e..eb4f619 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertHoldCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertHoldCLI.java
@@ -69,6 +69,12 @@ public class CertHoldCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/cert/CertReleaseHoldCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertReleaseHoldCLI.java
index aa58539..5917a01 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertReleaseHoldCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertReleaseHoldCLI.java
@@ -62,6 +62,12 @@ public class CertReleaseHoldCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestFindCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestFindCLI.java
index d547b8d..8024a04 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestFindCLI.java
@@ -60,8 +60,9 @@ public class CertRequestFindCLI extends CLI {
         }
 
         if (cmd.hasOption("help")) {
+            // Display usage
             printHelp();
-            System.exit(-1);
+            System.exit(0);
         }
 
         String s = cmd.getOptionValue("start");
@@ -134,8 +135,5 @@ public class CertRequestFindCLI extends CLI {
         option = new Option(null, "timeout", true, "Search timeout");
         option.setArgName("maxTime");
         options.addOption(option);
-
-        //help
-        options.addOption(null, "help", false, "Show help options");
     }
 }
diff --git a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestProfileFindCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestProfileFindCLI.java
index 7217253..85616a9 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestProfileFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestProfileFindCLI.java
@@ -46,6 +46,12 @@ public class CertRequestProfileFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String s = cmd.getOptionValue("start");
         Integer start = s == null ? null : Integer.valueOf(s);
 
diff --git a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestProfileShowCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestProfileShowCLI.java
index df83b19..396eca6 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestProfileShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestProfileShowCLI.java
@@ -37,6 +37,12 @@ public class CertRequestProfileShowCLI extends CLI {
             System.exit(-1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cLineArgs = cmd.getArgs();
         if (cLineArgs.length < 1) {
             System.err.println("Error: Missing profile ID.");
diff --git a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestReviewCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestReviewCLI.java
index d39a703..672b7b5 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestReviewCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestReviewCLI.java
@@ -59,6 +59,12 @@ public class CertRequestReviewCLI extends CLI {
             System.exit(-1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cLineArgs = cmd.getArgs();
         if (cLineArgs.length < 1) {
             System.err.println("Error: Missing certificate request ID.");
diff --git a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestShowCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestShowCLI.java
index ca8fcb2..ca3ac44 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestShowCLI.java
@@ -34,6 +34,12 @@ public class CertRequestShowCLI extends CLI {
             System.exit(-1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cLineArgs = cmd.getArgs();
         if (cLineArgs.length < 1) {
             System.err.println("Error: Missing certificate request ID.");
diff --git a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestSubmitCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestSubmitCLI.java
index 205e288..481a643 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestSubmitCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestSubmitCLI.java
@@ -41,6 +41,12 @@ public class CertRequestSubmitCLI extends CLI {
             System.exit(-1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cLineArgs = cmd.getArgs();
 
         if (cLineArgs.length < 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/cert/CertRevokeCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertRevokeCLI.java
index 49ec889..87d5869 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRevokeCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRevokeCLI.java
@@ -86,6 +86,12 @@ public class CertRevokeCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/cert/CertShowCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertShowCLI.java
index a048ebf..d486742 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertShowCLI.java
@@ -65,6 +65,12 @@ public class CertShowCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         boolean showPrettyPrint = cmd.hasOption("pretty");
         boolean showEncoded = cmd.hasOption("encoded");
 
diff --git a/base/java-tools/src/com/netscape/cmstools/cli/CLI.java b/base/java-tools/src/com/netscape/cmstools/cli/CLI.java
index 4e904c2..ed01edc 100644
--- a/base/java-tools/src/com/netscape/cmstools/cli/CLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cli/CLI.java
@@ -176,9 +176,10 @@ public class CLI {
 
     public void execute(String[] args) throws Exception {
 
-        if (args.length == 0) {
+        if ((args.length == 0) || (args[0].equals("--help"))) {
+            // Print commands associated with this module
             printHelp();
-            System.exit(1);
+            System.exit(0);
         }
 
         // A command consists of parts joined by dashes: <part 1>-<part 2>-...-<part N>.
@@ -258,6 +259,9 @@ public class CLI {
             System.arraycopy(args, 1, moduleArgs, 0, args.length-1);
         }
 
+        // Add "--help" option to all command modules
+        module.options.addOption(null, "help", false, "Show help options");
+
         module.execute(moduleArgs);
     }
 
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 4e9d0c8..f4511b9 100644
--- a/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java
@@ -316,12 +316,13 @@ public class MainCLI extends CLI {
 
         if (cmd.hasOption("version")) {
             printVersion();
-            System.exit(1);
+            System.exit(0);
         }
 
         if (cmdArgs.length == 0 || cmd.hasOption("help")) {
+            // Print 'pki' usage
             printHelp();
-            System.exit(1);
+            System.exit(0);
         }
 
         parseOptions(cmd);
diff --git a/base/java-tools/src/com/netscape/cmstools/client/ClientCertFindCLI.java b/base/java-tools/src/com/netscape/cmstools/client/ClientCertFindCLI.java
index 874a897..12dde44 100644
--- a/base/java-tools/src/com/netscape/cmstools/client/ClientCertFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/client/ClientCertFindCLI.java
@@ -54,6 +54,12 @@ public class ClientCertFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         client = parent.getClient();
 
         X509Certificate[] certs;
diff --git a/base/java-tools/src/com/netscape/cmstools/client/ClientCertImportCLI.java b/base/java-tools/src/com/netscape/cmstools/client/ClientCertImportCLI.java
index 8494c93..185e241 100644
--- a/base/java-tools/src/com/netscape/cmstools/client/ClientCertImportCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/client/ClientCertImportCLI.java
@@ -68,6 +68,12 @@ public class ClientCertImportCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         client = parent.getClient();
 
         byte[] bytes = null;
diff --git a/base/java-tools/src/com/netscape/cmstools/client/ClientCertRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/client/ClientCertRemoveCLI.java
index 89ff6de..70ada90 100644
--- a/base/java-tools/src/com/netscape/cmstools/client/ClientCertRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/client/ClientCertRemoveCLI.java
@@ -51,6 +51,12 @@ public class ClientCertRemoveCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/client/ClientInitCLI.java b/base/java-tools/src/com/netscape/cmstools/client/ClientInitCLI.java
index 94fd482..50a39ac 100644
--- a/base/java-tools/src/com/netscape/cmstools/client/ClientInitCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/client/ClientInitCLI.java
@@ -58,6 +58,12 @@ public class ClientInitCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         MainCLI mainCLI = (MainCLI)parent.getParent();
 
         if (mainCLI.config.getCertPassword() == null) {
diff --git a/base/java-tools/src/com/netscape/cmstools/group/GroupAddCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupAddCLI.java
index 47153cd..4fd7808 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupAddCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.group;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
@@ -43,6 +45,13 @@ public class GroupAddCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "description", true, "Description");
         option.setArgName("description");
         option.setRequired(true);
diff --git a/base/java-tools/src/com/netscape/cmstools/group/GroupFindCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupFindCLI.java
index b7bc81d..8cb54b1 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupFindCLI.java
@@ -65,6 +65,12 @@ public class GroupFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
         String filter = cmdArgs.length > 0 ? cmdArgs[0] : null;
 
diff --git a/base/java-tools/src/com/netscape/cmstools/group/GroupMemberAddCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupMemberAddCLI.java
index 94d1a11..ec01cbb 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupMemberAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupMemberAddCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.group;
 
+import java.util.Arrays;
+
 import com.netscape.certsrv.group.GroupMemberData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -40,6 +42,13 @@ public class GroupMemberAddCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 2) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/group/GroupMemberFindCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupMemberFindCLI.java
index 841a0f8..b5100e3 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupMemberFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupMemberFindCLI.java
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.group;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -46,6 +47,13 @@ public class GroupMemberFindCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -65,6 +73,12 @@ public class GroupMemberFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/group/GroupMemberRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupMemberRemoveCLI.java
index 3165aa0..8947b5f 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupMemberRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupMemberRemoveCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.group;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -39,6 +41,13 @@ public class GroupMemberRemoveCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 2) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/group/GroupMemberShowCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupMemberShowCLI.java
index 26a096f..4e10c33 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupMemberShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupMemberShowCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.group;
 
+import java.util.Arrays;
+
 import com.netscape.certsrv.group.GroupMemberData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -40,6 +42,13 @@ public class GroupMemberShowCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 2) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/group/GroupModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupModifyCLI.java
index b0974d3..f7c522b 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupModifyCLI.java
@@ -58,6 +58,12 @@ public class GroupModifyCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/group/GroupRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupRemoveCLI.java
index cc64ed8..e27f8d5 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupRemoveCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.group;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -40,6 +42,13 @@ public class GroupRemoveCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/group/GroupShowCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupShowCLI.java
index c25306a..9f61766 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupShowCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.group;
 
+import java.util.Arrays;
+
 import com.netscape.certsrv.group.GroupData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -40,6 +42,13 @@ public class GroupShowCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyArchiveCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyArchiveCLI.java
index c057a9e..49ffe71 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyArchiveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyArchiveCLI.java
@@ -53,10 +53,13 @@ public class KeyArchiveCLI extends CLI {
             printHelp();
             System.exit(1);
         }
+
         if (cmd.hasOption("help")) {
+            // Display usage
             printHelp();
-            System.exit(1);
+            System.exit(0);
         }
+
         String requestFile = cmd.getOptionValue("input");
 
         KeyRequestResponse response = null;
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
index e2b8ef8..43310aa 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
@@ -81,9 +81,11 @@ public class KeyFindCLI extends CLI {
             printHelp();
             System.exit(1);
         }
+
         if (cmd.hasOption("help")) {
+            // Display usage
             printHelp();
-            System.exit(1);
+            System.exit(0);
         }
 
         String clientKeyID = cmd.getOptionValue("client");
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyGenerateCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyGenerateCLI.java
index 0ec02d5..3a2aa86 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyGenerateCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyGenerateCLI.java
@@ -25,6 +25,14 @@ public class KeyGenerateCLI extends CLI {
     }
 
     public void execute(String[] args) {
+
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "key-algorithm", true,
                 "Algorithm to be used to create a key.\nValid values: AES, DES, DES3, RC2, RC4, DESede.");
         option.setArgName("algorithm");
@@ -55,11 +63,6 @@ public class KeyGenerateCLI extends CLI {
             System.exit(1);
         }
 
-        if (cmd.hasOption("help")) {
-            printHelp();
-            System.exit(1);
-        }
-
         String[] cmdArgs = cmd.getArgs();
         if (cmdArgs.length < 1) {
             System.err.println("Error: Missing the Client Key Id");
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyModifyCLI.java
index 483cc23..4378080 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyModifyCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.key;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.ParseException;
@@ -40,6 +42,13 @@ public class KeyModifyCLI extends CLI {
 
     public void execute(String[] args) {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "status", true, "Status of the key.\nValid values: active, inactive");
         option.setRequired(true);
         option.setArgName("status");
@@ -55,11 +64,6 @@ public class KeyModifyCLI extends CLI {
             System.exit(1);
         }
 
-        if (cmd.hasOption("help")) {
-            printHelp();
-            System.exit(1);
-        }
-
         String status = cmd.getOptionValue("status");
         if (status == null) {
             System.out.println("No status:: " + status);
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyRecoverCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyRecoverCLI.java
index d12e76a..cdaf6b6 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyRecoverCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyRecoverCLI.java
@@ -51,9 +51,11 @@ public class KeyRecoverCLI extends CLI {
         }
 
         if (cmd.hasOption("help")) {
+            // Display usage
             printHelp();
-            System.exit(1);
+            System.exit(0);
         }
+
         String requestFile = cmd.getOptionValue("input");
 
         KeyRequestResponse response = null;
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java
index 96a4dfa..2045104 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java
@@ -88,8 +88,9 @@ public class KeyRequestFindCLI extends CLI {
         }
 
         if (cmd.hasOption("help")) {
+            // Display usage
             printHelp();
-            System.exit(1);
+            System.exit(0);
         }
 
         String status = cmd.getOptionValue("status");
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestReviewCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestReviewCLI.java
index bf17fb2..5464625 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestReviewCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestReviewCLI.java
@@ -1,5 +1,7 @@
 package com.netscape.cmstools.key;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.ParseException;
@@ -22,6 +24,14 @@ public class KeyRequestReviewCLI extends CLI {
     }
 
     public void execute(String[] args) {
+
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "action", true,
                 "Action to be performed on the request.\nValid values: approve, reject, cancel.");
         option.setArgName("Action to perform");
@@ -38,11 +48,6 @@ public class KeyRequestReviewCLI extends CLI {
             System.exit(1);
         }
 
-        if (cmd.hasOption("help")) {
-            printHelp();
-            System.exit(1);
-        }
-
         String[] cmdArgs = cmd.getArgs();
         if (cmdArgs.length != 1) {
             System.err.println("Error: Invalid arguments provided.");
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestShowCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestShowCLI.java
index 7f615eb..0459fa7 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestShowCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.key;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.ParseException;
 
@@ -40,6 +42,13 @@ public class KeyRequestShowCLI extends CLI {
 
     public void execute(String[] args) {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(-1);
@@ -53,10 +62,6 @@ public class KeyRequestShowCLI extends CLI {
             printHelp();
             System.exit(1);
         }
-        if (cmd.hasOption("help")) {
-            printHelp();
-            System.exit(1);
-        }
 
         RequestId requestId = new RequestId(args[0].trim());
 
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyRetrieveCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyRetrieveCLI.java
index 0621c3c..095595f 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyRetrieveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyRetrieveCLI.java
@@ -60,9 +60,11 @@ public class KeyRetrieveCLI extends CLI {
             printHelp();
             System.exit(1);
         }
+
         if (cmd.hasOption("help")) {
+            // Display usage
             printHelp();
-            System.exit(1);
+            System.exit(0);
         }
 
         if(cmd.getOptions().length==0){
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyShowCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyShowCLI.java
index a3d918e..172f249 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyShowCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.key;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.ParseException;
 
@@ -40,6 +42,13 @@ public class KeyShowCLI extends CLI {
 
     public void execute(String[] args) {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(-1);
@@ -53,10 +62,6 @@ public class KeyShowCLI extends CLI {
             printHelp();
             System.exit(1);
         }
-        if (cmd.hasOption("help")) {
-            printHelp();
-            System.exit(1);
-        }
 
         KeyId keyId = new KeyId(args[0].trim());
 
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateFindCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateFindCLI.java
index 18fd53c..5fc869d 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateFindCLI.java
@@ -40,9 +40,11 @@ public class KeyTemplateFindCLI extends CLI {
             printHelp();
             System.exit(1);
         }
+
         if (cmd.hasOption("help")) {
+            // Display usage
             printHelp();
-            System.exit(1);
+            System.exit(0);
         }
 
         try {
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateShowCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateShowCLI.java
index 2ce8afe..6e73652 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateShowCLI.java
@@ -3,6 +3,7 @@ package com.netscape.cmstools.key;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.util.Arrays;
 
 import javax.xml.bind.JAXBException;
 
@@ -30,6 +31,13 @@ public class KeyTemplateShowCLI extends CLI {
 
     public void execute(String[] args) {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "output-file", true, "Location where the template has to be stored.");
         option.setArgName("File to write the template to.");
         options.addOption(option);
@@ -49,11 +57,6 @@ public class KeyTemplateShowCLI extends CLI {
             System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            printHelp();
-            System.exit(1);
-        }
-
         String templateId = cmdArgs[0];
         String writeToFile = cmd.getOptionValue("output-file");
         String templateDir = "/usr/share/pki/key/templates/";
diff --git a/base/java-tools/src/com/netscape/cmstools/logging/ActivityFindCLI.java b/base/java-tools/src/com/netscape/cmstools/logging/ActivityFindCLI.java
index d9daf92..705c7b7 100644
--- a/base/java-tools/src/com/netscape/cmstools/logging/ActivityFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/logging/ActivityFindCLI.java
@@ -65,6 +65,12 @@ public class ActivityFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
         String filter = cmdArgs.length > 0 ? cmdArgs[0] : null;
 
diff --git a/base/java-tools/src/com/netscape/cmstools/logging/ActivityShowCLI.java b/base/java-tools/src/com/netscape/cmstools/logging/ActivityShowCLI.java
index 6fa49c9..091cf36 100644
--- a/base/java-tools/src/com/netscape/cmstools/logging/ActivityShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/logging/ActivityShowCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.logging;
 
+import java.util.Arrays;
+
 import com.netscape.certsrv.logging.ActivityData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -40,6 +42,13 @@ public class ActivityShowCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/logging/AuditModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/logging/AuditModifyCLI.java
index d37b976..26411d1 100644
--- a/base/java-tools/src/com/netscape/cmstools/logging/AuditModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/logging/AuditModifyCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.logging;
 
+import java.util.Arrays;
+
 import java.io.BufferedReader;
 import java.io.FileReader;
 import java.io.FileWriter;
@@ -49,6 +51,13 @@ public class AuditModifyCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "action", true, "Action: update (default), enable, disable.");
         option.setArgName("action");
         options.addOption(option);
diff --git a/base/java-tools/src/com/netscape/cmstools/logging/AuditShowCLI.java b/base/java-tools/src/com/netscape/cmstools/logging/AuditShowCLI.java
index 9968d72..f82510e 100644
--- a/base/java-tools/src/com/netscape/cmstools/logging/AuditShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/logging/AuditShowCLI.java
@@ -61,6 +61,12 @@ public class AuditShowCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
diff --git a/base/java-tools/src/com/netscape/cmstools/profile/ProfileAddCLI.java b/base/java-tools/src/com/netscape/cmstools/profile/ProfileAddCLI.java
index 8e95b83..698b15e 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileAddCLI.java
@@ -35,6 +35,12 @@ public class ProfileAddCLI extends CLI {
             System.exit(-1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cLineArgs = cmd.getArgs();
 
         if (cLineArgs.length < 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/profile/ProfileDisableCLI.java b/base/java-tools/src/com/netscape/cmstools/profile/ProfileDisableCLI.java
index 4fc640d..8711bfd 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileDisableCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileDisableCLI.java
@@ -1,5 +1,7 @@
 package com.netscape.cmstools.profile;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -18,6 +20,13 @@ public class ProfileDisableCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/profile/ProfileEnableCLI.java b/base/java-tools/src/com/netscape/cmstools/profile/ProfileEnableCLI.java
index 88c96c5..099c24a 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileEnableCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileEnableCLI.java
@@ -1,5 +1,7 @@
 package com.netscape.cmstools.profile;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -18,6 +20,13 @@ public class ProfileEnableCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/profile/ProfileFindCLI.java b/base/java-tools/src/com/netscape/cmstools/profile/ProfileFindCLI.java
index 2155955..bbadca6 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileFindCLI.java
@@ -44,6 +44,12 @@ public class ProfileFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String s = cmd.getOptionValue("start");
         Integer start = s == null ? null : Integer.valueOf(s);
 
diff --git a/base/java-tools/src/com/netscape/cmstools/profile/ProfileModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/profile/ProfileModifyCLI.java
index 9fce7d2..00c557d 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileModifyCLI.java
@@ -35,6 +35,12 @@ public class ProfileModifyCLI extends CLI {
             System.exit(-1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cLineArgs = cmd.getArgs();
 
         if (cLineArgs.length < 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/profile/ProfileRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/profile/ProfileRemoveCLI.java
index 92c99ed..f23113f 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileRemoveCLI.java
@@ -1,5 +1,7 @@
 package com.netscape.cmstools.profile;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -18,6 +20,13 @@ public class ProfileRemoveCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/profile/ProfileShowCLI.java b/base/java-tools/src/com/netscape/cmstools/profile/ProfileShowCLI.java
index 6b09d7f..64161b8 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileShowCLI.java
@@ -36,6 +36,12 @@ public class ProfileShowCLI extends CLI {
             System.exit(-1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cLineArgs = cmd.getArgs();
         if (cLineArgs.length < 1) {
             System.err.println("Error: Missing profile ID.");
diff --git a/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestFindCLI.java b/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestFindCLI.java
index 82909f6..22289da 100644
--- a/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestFindCLI.java
@@ -65,6 +65,12 @@ public class SelfTestFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
         String filter = cmdArgs.length > 0 ? cmdArgs[0] : null;
 
diff --git a/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestRunCLI.java b/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestRunCLI.java
index b4b5108..bb80cfc 100644
--- a/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestRunCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestRunCLI.java
@@ -52,6 +52,12 @@ public class SelfTestRunCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
diff --git a/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestShowCLI.java b/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestShowCLI.java
index 88527b3..f579c1f 100644
--- a/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestShowCLI.java
@@ -61,6 +61,12 @@ public class SelfTestShowCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/system/KRAConnectorAddCLI.java b/base/java-tools/src/com/netscape/cmstools/system/KRAConnectorAddCLI.java
index cc08d75..d3ddd56 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/KRAConnectorAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/KRAConnectorAddCLI.java
@@ -57,6 +57,12 @@ public class KRAConnectorAddCLI extends CLI {
             System.exit(-1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cLineArgs = cmd.getArgs();
 
         if (cLineArgs.length < 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/system/KRAConnectorRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/system/KRAConnectorRemoveCLI.java
index 550b661..ccd2cae 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/KRAConnectorRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/KRAConnectorRemoveCLI.java
@@ -17,6 +17,8 @@
 // --- END COPYRIGHT BLOCK ---
 package com.netscape.cmstools.system;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -38,6 +40,13 @@ public class KRAConnectorRemoveCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 2) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/system/SecurityDomainGetInstallTokenCLI.java b/base/java-tools/src/com/netscape/cmstools/system/SecurityDomainGetInstallTokenCLI.java
index f05535c..d7fb4b1 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/SecurityDomainGetInstallTokenCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/SecurityDomainGetInstallTokenCLI.java
@@ -19,6 +19,7 @@
 package com.netscape.cmstools.system;
 
 import java.net.InetAddress;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -45,6 +46,13 @@ public class SecurityDomainGetInstallTokenCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "hostname", true, "Hostname");
         option.setArgName("hostname");
         options.addOption(option);
diff --git a/base/java-tools/src/com/netscape/cmstools/system/SecurityDomainShowCLI.java b/base/java-tools/src/com/netscape/cmstools/system/SecurityDomainShowCLI.java
index c0efa9f..a23bc52 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/SecurityDomainShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/SecurityDomainShowCLI.java
@@ -52,6 +52,12 @@ public class SecurityDomainShowCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
diff --git a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorAddCLI.java b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorAddCLI.java
index 7a5f194..fdf9ce8 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorAddCLI.java
@@ -58,6 +58,12 @@ public class TPSConnectorAddCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String tpsHost = cmd.getOptionValue("host");
         String tpsPort = cmd.getOptionValue("port");
 
diff --git a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorFindCLI.java b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorFindCLI.java
index a210d3a..d69232b 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorFindCLI.java
@@ -64,6 +64,12 @@ public class TPSConnectorFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String s = cmd.getOptionValue("start");
         Integer start = s == null ? null : Integer.valueOf(s);
 
diff --git a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorModCLI.java b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorModCLI.java
index 339c66b..e098f5b 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorModCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorModCLI.java
@@ -39,6 +39,12 @@ public class TPSConnectorModCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
         if (cmdArgs.length != 1) {
             printHelp();
diff --git a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorRemoveCLI.java
index 875e595..d440814 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorRemoveCLI.java
@@ -58,6 +58,12 @@ public class TPSConnectorRemoveCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String tpsHost = cmd.getOptionValue("host");
         String tpsPort = cmd.getOptionValue("port");
 
diff --git a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorShowCLI.java b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorShowCLI.java
index 43d28c8..03a5606 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorShowCLI.java
@@ -17,6 +17,8 @@
 // --- END COPYRIGHT BLOCK ---
 package com.netscape.cmstools.system;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
@@ -42,6 +44,13 @@ public class TPSConnectorShowCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "host", true, "TPS host");
         option.setArgName("host");
         option.setRequired(true);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorAddCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorAddCLI.java
index 59ec2f7..43a58c8 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorAddCLI.java
@@ -22,6 +22,7 @@ import java.io.BufferedReader;
 import java.io.FileReader;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -48,6 +49,13 @@ public class AuthenticatorAddCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "input", true, "Input file containing authenticator properties.");
         option.setArgName("file");
         option.setRequired(true);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorFindCLI.java
index 552fc30..4441bcd 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorFindCLI.java
@@ -65,6 +65,12 @@ public class AuthenticatorFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
         String filter = cmdArgs.length > 0 ? cmdArgs[0] : null;
 
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorModifyCLI.java
index 0f82d1e..10e2a5e 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorModifyCLI.java
@@ -67,6 +67,12 @@ public class AuthenticatorModifyCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorRemoveCLI.java
index 6d565bc..02bf1b1 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorRemoveCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.tps.authenticator;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -39,6 +41,13 @@ public class AuthenticatorRemoveCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorShowCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorShowCLI.java
index af1290a..65e3d67 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorShowCLI.java
@@ -61,6 +61,12 @@ public class AuthenticatorShowCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/cert/TPSCertFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/cert/TPSCertFindCLI.java
index 91c460b..a57ab63 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/cert/TPSCertFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/cert/TPSCertFindCLI.java
@@ -65,6 +65,12 @@ public class TPSCertFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
         String filter = cmdArgs.length > 0 ? cmdArgs[0] : null;
 
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/cert/TPSCertShowCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/cert/TPSCertShowCLI.java
index b20e9a6..23efd67 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/cert/TPSCertShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/cert/TPSCertShowCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.tps.cert;
 
+import java.util.Arrays;
+
 import com.netscape.certsrv.tps.cert.TPSCertData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -40,6 +42,13 @@ public class TPSCertShowCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/config/ConfigModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/config/ConfigModifyCLI.java
index fb7e2f0..0665471 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/config/ConfigModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/config/ConfigModifyCLI.java
@@ -23,6 +23,7 @@ import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -49,6 +50,13 @@ public class ConfigModifyCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "input", true, "Input file containing general properties.");
         option.setArgName("file");
         option.setRequired(true);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/config/ConfigShowCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/config/ConfigShowCLI.java
index 33bc781..c04d6f5 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/config/ConfigShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/config/ConfigShowCLI.java
@@ -61,6 +61,12 @@ public class ConfigShowCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionAddCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionAddCLI.java
index 5b9cf87..eb49fcb 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionAddCLI.java
@@ -22,6 +22,7 @@ import java.io.BufferedReader;
 import java.io.FileReader;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -48,6 +49,13 @@ public class ConnectionAddCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "input", true, "Input file containing connection properties.");
         option.setArgName("file");
         option.setRequired(true);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionFindCLI.java
index 9d2165e..ad4ac00 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionFindCLI.java
@@ -65,6 +65,12 @@ public class ConnectionFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
         String filter = cmdArgs.length > 0 ? cmdArgs[0] : null;
 
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionModifyCLI.java
index 4c1d992..a052618 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionModifyCLI.java
@@ -67,6 +67,12 @@ public class ConnectionModifyCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionRemoveCLI.java
index 5169f23..0080655 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionRemoveCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.tps.connection;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -39,6 +41,13 @@ public class ConnectionRemoveCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionShowCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionShowCLI.java
index 455518e..852e330 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionShowCLI.java
@@ -61,6 +61,12 @@ public class ConnectionShowCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileAddCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileAddCLI.java
index 503e9c5..70e0e8c 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileAddCLI.java
@@ -22,6 +22,7 @@ import java.io.BufferedReader;
 import java.io.FileReader;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -48,6 +49,13 @@ public class ProfileAddCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "input", true, "Input file containing profile properties.");
         option.setArgName("file");
         option.setRequired(true);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileFindCLI.java
index 251d14d..5f6b20c 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileFindCLI.java
@@ -65,6 +65,12 @@ public class ProfileFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
         String filter = cmdArgs.length > 0 ? cmdArgs[0] : null;
 
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingAddCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingAddCLI.java
index bc0cb92..bf9601e 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingAddCLI.java
@@ -22,6 +22,7 @@ import java.io.BufferedReader;
 import java.io.FileReader;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -48,6 +49,13 @@ public class ProfileMappingAddCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "input", true, "Input file containing profile mapping properties.");
         option.setArgName("file");
         option.setRequired(true);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingFindCLI.java
index e125629..1946820 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingFindCLI.java
@@ -65,6 +65,12 @@ public class ProfileMappingFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
         String filter = cmdArgs.length > 0 ? cmdArgs[0] : null;
 
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingModifyCLI.java
index d7c82de..8a4adc5 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingModifyCLI.java
@@ -67,6 +67,12 @@ public class ProfileMappingModifyCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingRemoveCLI.java
index f64c12c..0fa33b3 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingRemoveCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.tps.profile;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -39,6 +41,13 @@ public class ProfileMappingRemoveCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingShowCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingShowCLI.java
index c715a3e..b582066 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingShowCLI.java
@@ -61,6 +61,12 @@ public class ProfileMappingShowCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileModifyCLI.java
index 8f907ab..5231828 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileModifyCLI.java
@@ -67,6 +67,12 @@ public class ProfileModifyCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileRemoveCLI.java
index 2091310..23fceb3 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileRemoveCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.tps.profile;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -39,6 +41,13 @@ public class ProfileRemoveCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileShowCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileShowCLI.java
index 7c4c2fa..37d1ed4 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileShowCLI.java
@@ -61,6 +61,12 @@ public class ProfileShowCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenAddCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenAddCLI.java
index bb9d452..396dbc6 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenAddCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.tps.token;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
@@ -43,6 +45,13 @@ public class TokenAddCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "user", true, "User ID");
         option.setArgName("User ID");
         option.setRequired(true);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenFindCLI.java
index 22fbad9..bb1a166 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenFindCLI.java
@@ -65,6 +65,12 @@ public class TokenFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
         String filter = cmdArgs.length > 0 ? cmdArgs[0] : null;
 
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenModifyCLI.java
index 28559e1..beb2373 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenModifyCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.tps.token;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
@@ -43,6 +45,13 @@ public class TokenModifyCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "user", true, "User ID");
         option.setArgName("User ID");
         option.setRequired(true);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenRemoveCLI.java
index f522991..60e5c9a 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenRemoveCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.tps.token;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -39,6 +41,13 @@ public class TokenRemoveCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenShowCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenShowCLI.java
index 14190ef..65ee320 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenShowCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.tps.token;
 
+import java.util.Arrays;
+
 import com.netscape.certsrv.tps.token.TokenData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -40,6 +42,13 @@ public class TokenShowCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserAddCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserAddCLI.java
index 5e22522..903b72e 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserAddCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.user;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
@@ -43,6 +45,13 @@ public class UserAddCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "fullName", true, "Full name");
         option.setArgName("fullName");
         option.setRequired(true);
diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserCertAddCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserCertAddCLI.java
index 1a1ce5e..4ee1f0d 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserCertAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserCertAddCLI.java
@@ -19,6 +19,7 @@
 package com.netscape.cmstools.user;
 
 import java.io.File;
+import java.util.Arrays;
 import java.util.Scanner;
 
 import org.apache.commons.cli.CommandLine;
@@ -46,6 +47,13 @@ public class UserCertAddCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help" prior to parsing due to required option
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "input", true, "Input file");
         option.setArgName("file");
         option.setRequired(true);
diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserCertFindCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserCertFindCLI.java
index dd8f687..e5e921e 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserCertFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserCertFindCLI.java
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.user;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -46,6 +47,13 @@ public class UserCertFindCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -65,6 +73,12 @@ public class UserCertFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserCertRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserCertRemoveCLI.java
index ed88163..5c01db2 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserCertRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserCertRemoveCLI.java
@@ -19,6 +19,7 @@
 package com.netscape.cmstools.user;
 
 import java.net.URLEncoder;
+import java.util.Arrays;
 
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -42,6 +43,13 @@ public class UserCertRemoveCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 2) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserCertShowCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserCertShowCLI.java
index e07de6d..6f75bfa 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserCertShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserCertShowCLI.java
@@ -21,6 +21,7 @@ package com.netscape.cmstools.user;
 import java.io.FileWriter;
 import java.io.PrintWriter;
 import java.net.URLEncoder;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -47,6 +48,13 @@ public class UserCertShowCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "output", true, "Output file");
         option.setArgName("file");
         options.addOption(option);
@@ -65,6 +73,12 @@ public class UserCertShowCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         boolean showPrettyPrint = cmd.hasOption("pretty");
         boolean showEncoded = cmd.hasOption("encoded");
 
diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserFindCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserFindCLI.java
index 6142a37..2dfa45b 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserFindCLI.java
@@ -65,6 +65,12 @@ public class UserFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
         String filter = cmdArgs.length > 0 ? cmdArgs[0] : null;
 
diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserMembershipAddCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserMembershipAddCLI.java
index 1b9925c..468ed40 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserMembershipAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserMembershipAddCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.user;
 
+import java.util.Arrays;
+
 import com.netscape.certsrv.user.UserMembershipData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -40,6 +42,13 @@ public class UserMembershipAddCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 2) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserMembershipFindCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserMembershipFindCLI.java
index 33ea72d..ddcf9f2 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserMembershipFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserMembershipFindCLI.java
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.user;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -46,6 +47,13 @@ public class UserMembershipFindCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -65,6 +73,12 @@ public class UserMembershipFindCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserMembershipRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserMembershipRemoveCLI.java
index b5d0948..493582d 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserMembershipRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserMembershipRemoveCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.user;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -39,6 +41,13 @@ public class UserMembershipRemoveCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 2) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserModifyCLI.java
index a09e0fc..2d685c9 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserModifyCLI.java
@@ -79,6 +79,12 @@ public class UserModifyCLI extends CLI {
             System.exit(1);
         }
 
+        if (cmd.hasOption("help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserRemoveCLI.java
index b26b4ae..ffc6c1e 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserRemoveCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.user;
 
+import java.util.Arrays;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -39,6 +41,13 @@ public class UserRemoveCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserShowCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserShowCLI.java
index ce0623e..95f4d31 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserShowCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.user;
 
+import java.util.Arrays;
+
 import com.netscape.certsrv.user.UserData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -40,6 +42,13 @@ public class UserShowCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
+        // Check for "--help"
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         if (args.length != 1) {
             printHelp();
             System.exit(1);
-- 
1.9.0

