From a96cdf50bcae39a9ea7e1727d414293ce7ba0a91 Mon Sep 17 00:00:00 2001
From: Matthew Harmsen <mharmsen@redhat.com>
Date: Fri, 25 Apr 2014 19:55:35 -0700
Subject: [PATCH] Fixed issue by streamlining code to be more consistent.

* PKI TRAC Ticket #843 - Incorrect CLI argument parsing
---
 .../com/netscape/cmstools/cert/CertFindCLI.java    | 189 +++++++++++----------
 .../com/netscape/cmstools/cert/CertHoldCLI.java    |  28 +--
 .../netscape/cmstools/cert/CertReleaseHoldCLI.java |  28 +--
 .../netscape/cmstools/cert/CertRequestFindCLI.java |  85 ++++-----
 .../cmstools/cert/CertRequestProfileFindCLI.java   |  27 ++-
 .../cmstools/cert/CertRequestProfileShowCLI.java   |  34 ++--
 .../cmstools/cert/CertRequestReviewCLI.java        |  34 ++--
 .../netscape/cmstools/cert/CertRequestShowCLI.java |  27 +--
 .../cmstools/cert/CertRequestSubmitCLI.java        |  22 +--
 .../com/netscape/cmstools/cert/CertRevokeCLI.java  |  30 ++--
 .../com/netscape/cmstools/cert/CertShowCLI.java    |  32 ++--
 .../src/com/netscape/cmstools/cli/HelpCLI.java     |   2 +-
 .../src/com/netscape/cmstools/cli/MainCLI.java     |   8 +-
 .../cmstools/client/ClientCertFindCLI.java         |  29 +++-
 .../cmstools/client/ClientCertImportCLI.java       |  31 +++-
 .../cmstools/client/ClientCertRemoveCLI.java       |  22 ++-
 .../netscape/cmstools/client/ClientInitCLI.java    |  29 +++-
 .../com/netscape/cmstools/group/GroupAddCLI.java   |  24 +--
 .../com/netscape/cmstools/group/GroupFindCLI.java  |  23 ++-
 .../netscape/cmstools/group/GroupMemberAddCLI.java |  25 ++-
 .../cmstools/group/GroupMemberFindCLI.java         |  32 ++--
 .../cmstools/group/GroupMemberRemoveCLI.java       |  25 ++-
 .../cmstools/group/GroupMemberShowCLI.java         |  25 ++-
 .../netscape/cmstools/group/GroupModifyCLI.java    |  27 +--
 .../netscape/cmstools/group/GroupRemoveCLI.java    |  25 ++-
 .../com/netscape/cmstools/group/GroupShowCLI.java  |  25 ++-
 .../com/netscape/cmstools/key/KeyArchiveCLI.java   |  28 ++-
 .../src/com/netscape/cmstools/key/KeyFindCLI.java  |  25 ++-
 .../com/netscape/cmstools/key/KeyGenerateCLI.java  |  35 ++--
 .../com/netscape/cmstools/key/KeyModifyCLI.java    |  32 ++--
 .../com/netscape/cmstools/key/KeyRecoverCLI.java   |  28 ++-
 .../netscape/cmstools/key/KeyRequestFindCLI.java   |  25 ++-
 .../netscape/cmstools/key/KeyRequestReviewCLI.java |  32 ++--
 .../netscape/cmstools/key/KeyRequestShowCLI.java   |  17 +-
 .../com/netscape/cmstools/key/KeyRetrieveCLI.java  |  30 +++-
 .../src/com/netscape/cmstools/key/KeyShowCLI.java  |  20 ++-
 .../netscape/cmstools/key/KeyTemplateFindCLI.java  |  20 ++-
 .../netscape/cmstools/key/KeyTemplateShowCLI.java  |  21 ++-
 .../netscape/cmstools/logging/ActivityFindCLI.java |  23 ++-
 .../netscape/cmstools/logging/ActivityShowCLI.java |  25 ++-
 .../netscape/cmstools/logging/AuditModifyCLI.java  |  28 +--
 .../netscape/cmstools/logging/AuditShowCLI.java    |  28 +--
 .../netscape/cmstools/profile/ProfileAddCLI.java   |  23 +--
 .../cmstools/profile/ProfileDisableCLI.java        |  25 ++-
 .../cmstools/profile/ProfileEnableCLI.java         |  25 ++-
 .../netscape/cmstools/profile/ProfileFindCLI.java  |  27 ++-
 .../cmstools/profile/ProfileModifyCLI.java         |  23 +--
 .../cmstools/profile/ProfileRemoveCLI.java         |  25 ++-
 .../netscape/cmstools/profile/ProfileShowCLI.java  |  34 ++--
 .../cmstools/selftests/SelfTestFindCLI.java        |  23 ++-
 .../cmstools/selftests/SelfTestRunCLI.java         |  21 ++-
 .../cmstools/selftests/SelfTestShowCLI.java        |  28 +--
 .../cmstools/system/KRAConnectorAddCLI.java        |  21 +--
 .../cmstools/system/KRAConnectorRemoveCLI.java     |  25 ++-
 .../system/SecurityDomainGetInstallTokenCLI.java   |  28 +--
 .../cmstools/system/SecurityDomainShowCLI.java     |  21 ++-
 .../cmstools/system/TPSConnectorAddCLI.java        |  25 ++-
 .../cmstools/system/TPSConnectorFindCLI.java       |  25 ++-
 .../cmstools/system/TPSConnectorModCLI.java        |  27 ++-
 .../cmstools/system/TPSConnectorRemoveCLI.java     |  25 ++-
 .../cmstools/system/TPSConnectorShowCLI.java       |  33 ++--
 .../tps/authenticator/AuthenticatorAddCLI.java     |  24 +--
 .../tps/authenticator/AuthenticatorFindCLI.java    |  23 ++-
 .../tps/authenticator/AuthenticatorModifyCLI.java  |  28 +--
 .../tps/authenticator/AuthenticatorRemoveCLI.java  |  25 ++-
 .../tps/authenticator/AuthenticatorShowCLI.java    |  28 +--
 .../netscape/cmstools/tps/cert/TPSCertFindCLI.java |  23 ++-
 .../netscape/cmstools/tps/cert/TPSCertShowCLI.java |  25 ++-
 .../cmstools/tps/config/ConfigModifyCLI.java       |  34 ++--
 .../cmstools/tps/config/ConfigShowCLI.java         |  28 +--
 .../cmstools/tps/connection/ConnectionAddCLI.java  |  24 +--
 .../cmstools/tps/connection/ConnectionFindCLI.java |  23 ++-
 .../tps/connection/ConnectionModifyCLI.java        |  28 +--
 .../tps/connection/ConnectionRemoveCLI.java        |  25 ++-
 .../cmstools/tps/connection/ConnectionShowCLI.java |  28 +--
 .../cmstools/tps/profile/ProfileAddCLI.java        |  24 +--
 .../cmstools/tps/profile/ProfileFindCLI.java       |  23 ++-
 .../cmstools/tps/profile/ProfileMappingAddCLI.java |  24 +--
 .../tps/profile/ProfileMappingFindCLI.java         |  23 ++-
 .../tps/profile/ProfileMappingModifyCLI.java       |  28 +--
 .../tps/profile/ProfileMappingRemoveCLI.java       |  25 ++-
 .../tps/profile/ProfileMappingShowCLI.java         |  28 +--
 .../cmstools/tps/profile/ProfileModifyCLI.java     |  28 +--
 .../cmstools/tps/profile/ProfileRemoveCLI.java     |  25 ++-
 .../cmstools/tps/profile/ProfileShowCLI.java       |  28 +--
 .../netscape/cmstools/tps/token/TokenAddCLI.java   |  24 +--
 .../netscape/cmstools/tps/token/TokenFindCLI.java  |  23 ++-
 .../cmstools/tps/token/TokenModifyCLI.java         |  24 +--
 .../cmstools/tps/token/TokenRemoveCLI.java         |  25 ++-
 .../netscape/cmstools/tps/token/TokenShowCLI.java  |  25 ++-
 .../src/com/netscape/cmstools/user/UserAddCLI.java |  28 +--
 .../com/netscape/cmstools/user/UserCertAddCLI.java |  24 +--
 .../netscape/cmstools/user/UserCertFindCLI.java    |  32 ++--
 .../netscape/cmstools/user/UserCertRemoveCLI.java  |  25 ++-
 .../netscape/cmstools/user/UserCertShowCLI.java    |  38 ++---
 .../com/netscape/cmstools/user/UserFindCLI.java    |  23 ++-
 .../cmstools/user/UserMembershipAddCLI.java        |  25 ++-
 .../cmstools/user/UserMembershipFindCLI.java       |  32 ++--
 .../cmstools/user/UserMembershipRemoveCLI.java     |  25 ++-
 .../com/netscape/cmstools/user/UserModifyCLI.java  |  27 +--
 .../com/netscape/cmstools/user/UserRemoveCLI.java  |  25 ++-
 .../com/netscape/cmstools/user/UserShowCLI.java    |  25 ++-
 102 files changed, 1839 insertions(+), 1022 deletions(-)

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 333a3da..8c7a4df 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertFindCLI.java
@@ -21,6 +21,7 @@ package com.netscape.cmstools.cert;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Date;
 
@@ -46,102 +47,15 @@ public class CertFindCLI extends CLI {
     public CertFindCLI(CertCLI certCLI) {
         super("find", "Find certificates", certCLI);
         this.certCLI = certCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
-        addOptions();
-
-        CommandLine cmd = null;
-        CertSearchRequest searchData = null;
-        try {
-            cmd = parser.parse(options, args);
-        } catch (ParseException e) {
-            System.err.println("Error: " + e.getMessage());
-            printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
-
-        String fileName = null;
-
-        if (cmd.hasOption("input")) {
-            fileName = cmd.getOptionValue("input");
-            if (fileName == null || fileName.length() < 1) {
-                System.err.println("Error: No file name specified.");
-                printHelp();
-                System.exit(1);
-            }
-        }
-
-        if (fileName != null) {
-            FileReader reader = null;
-            try {
-                reader = new FileReader(fileName);
-                searchData = CertSearchRequest.valueOf(reader);
-
-            } catch (FileNotFoundException e) {
-                System.err.println("Error: " + e.getMessage());
-                System.exit(1);
-
-            } catch (JAXBException e) {
-                System.err.println("Error: " + e.getMessage());
-                System.exit(1);
-
-            } finally {
-                if (reader != null)
-                    try {
-                        reader.close();
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                    }
-            }
-
-        } else {
-            searchData = new CertSearchRequest();
-            searchData.setSerialNumberRangeInUse(true);
-        }
-
-        String s = cmd.getOptionValue("start");
-        Integer start = s == null ? null : Integer.valueOf(s);
-
-        s = cmd.getOptionValue("size");
-        Integer size = s == null ? null : Integer.valueOf(s);
-
-        addSearchAttribute(cmd, searchData);
-
-        CertDataInfos certs = certCLI.certClient.findCerts(searchData, start, size);
-
-        MainCLI.printMessage(certs.getTotal() + " entries found");
-        if (certs.getTotal() == 0) return;
-
-        boolean first = true;
-
-        Collection<CertDataInfo> entries = certs.getEntries();
-        for (CertDataInfo cert : entries) {
-            if (first) {
-                first = false;
-            } else {
-                System.out.println();
-            }
-
-            CertCLI.printCertInfo(cert);
-        }
-
-        MainCLI.printMessage("Number of entries returned " + certs.getEntries().size());
-    }
-
-    public void addOptions() {
-
+    public void createOptions() {
         Option option = null;
 
         //pagination options
@@ -277,6 +191,101 @@ public class CertFindCLI extends CLI {
         options.addOption(option);
     }
 
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+        } catch (ParseException e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
+            printHelp();
+            System.exit(-1);
+        }
+
+        CertSearchRequest searchData = null;
+        String fileName = null;
+
+        if (cmd.hasOption("input")) {
+            fileName = cmd.getOptionValue("input");
+            if (fileName == null || fileName.length() < 1) {
+                System.err.println("Error: No file name specified.");
+                printHelp();
+                System.exit(-1);
+            }
+        }
+
+        if (fileName != null) {
+            FileReader reader = null;
+            try {
+                reader = new FileReader(fileName);
+                searchData = CertSearchRequest.valueOf(reader);
+
+            } catch (FileNotFoundException e) {
+                System.err.println("Error: " + e.getMessage());
+                System.exit(-1);
+
+            } catch (JAXBException e) {
+                System.err.println("Error: " + e.getMessage());
+                System.exit(-1);
+
+            } finally {
+                if (reader != null)
+                    try {
+                        reader.close();
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+            }
+
+        } else {
+            searchData = new CertSearchRequest();
+            searchData.setSerialNumberRangeInUse(true);
+        }
+
+        String s = cmd.getOptionValue("start");
+        Integer start = s == null ? null : Integer.valueOf(s);
+
+        s = cmd.getOptionValue("size");
+        Integer size = s == null ? null : Integer.valueOf(s);
+
+        addSearchAttribute(cmd, searchData);
+
+        CertDataInfos certs = certCLI.certClient.findCerts(searchData, start, size);
+
+        MainCLI.printMessage(certs.getTotal() + " entries found");
+        if (certs.getTotal() == 0) return;
+
+        boolean first = true;
+
+        Collection<CertDataInfo> entries = certs.getEntries();
+        for (CertDataInfo cert : entries) {
+            if (first) {
+                first = false;
+            } else {
+                System.out.println();
+            }
+
+            CertCLI.printCertInfo(cert);
+        }
+
+        MainCLI.printMessage("Number of entries returned " + certs.getEntries().size());
+    }
+
     public Long convertValidityDurationUnit(String unit) {
 
         if (unit.equalsIgnoreCase("day")) {
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 eb4f619..a4b1848 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertHoldCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertHoldCLI.java
@@ -20,6 +20,7 @@ package com.netscape.cmstools.cert;
 
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
+import java.util.Arrays;
 
 import netscape.security.x509.RevocationReason;
 
@@ -44,19 +45,29 @@ public class CertHoldCLI extends CLI {
     public CertHoldCLI(CertCLI certCLI) {
         super("hold", "Place certificate on-hold", certCLI);
         this.certCLI = certCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <Serial Number> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "comments", true, "Comments");
         option.setArgName("comments");
         options.addOption(option);
 
         options.addOption(null, "force", false, "Force");
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -66,20 +77,15 @@ public class CertHoldCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: Missing Serial Number.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         CertId certID = new CertId(cmdArgs[0]);
@@ -98,7 +104,7 @@ public class CertHoldCLI extends CLI {
             BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
             String line = reader.readLine();
             if (!line.equalsIgnoreCase("Y")) {
-                System.exit(1);
+                System.exit(-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 5917a01..42a8ae9 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertReleaseHoldCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertReleaseHoldCLI.java
@@ -20,6 +20,7 @@ package com.netscape.cmstools.cert;
 
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 
@@ -41,15 +42,25 @@ public class CertReleaseHoldCLI extends CLI {
     public CertReleaseHoldCLI(CertCLI certCLI) {
         super("release-hold", "Place certificate off-hold", certCLI);
         this.certCLI = certCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <Serial Number> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         options.addOption(null, "force", false, "Force");
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -59,20 +70,15 @@ public class CertReleaseHoldCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: Missing Serial Number.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         CertId certID = new CertId(cmdArgs[0]);
@@ -91,7 +97,7 @@ public class CertReleaseHoldCLI extends CLI {
             BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
             String line = reader.readLine();
             if (!line.equalsIgnoreCase("Y")) {
-                System.exit(1);
+                System.exit(-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 8024a04..2d8779d 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestFindCLI.java
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.cert;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -40,17 +41,56 @@ public class CertRequestFindCLI extends CLI {
     public CertRequestFindCLI(CertCLI certCLI) {
         super("request-find", "Find certificate requests", certCLI);
         this.certCLI = certCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
+    public void createOptions() {
+        Option option = null;
+
+        // request state
+        option = new Option(null, "status", true, "Request status (pending, cancelled, rejected, complete, all)");
+        option.setArgName("status");
+        options.addOption(option);
 
-        addOptions();
+        // request type
+        option = new Option(null, "type", true, "Request type (enrollment, renewal, revocation, all)");
+        option.setArgName("type");
+        options.addOption(option);
+
+        //pagination options
+        option = new Option(null, "start", true, "Page start");
+        option.setArgName("start");
+        options.addOption(option);
+
+        option = new Option(null, "size", true, "Page size");
+        option.setArgName("size");
+        options.addOption(option);
+
+        //search limits
+        option = new Option(null, "maxResults", true, "Maximum number of results");
+        option.setArgName("maxResults");
+        options.addOption(option);
+
+        option = new Option(null, "timeout", true, "Search timeout");
+        option.setArgName("maxTime");
+        options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
         } catch (ParseException e) {
@@ -59,10 +99,12 @@ public class CertRequestFindCLI extends CLI {
             System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String s = cmd.getOptionValue("start");
@@ -103,37 +145,4 @@ public class CertRequestFindCLI extends CLI {
 
         MainCLI.printMessage("Number of entries returned " + entries.size());
     }
-
-    public void addOptions() {
-
-        Option option = null;
-
-        // request state
-        option = new Option(null, "status", true, "Request status (pending, cancelled, rejected, complete, all)");
-        option.setArgName("status");
-        options.addOption(option);
-
-        // request type
-        option = new Option(null, "type", true, "Request type (enrollment, renewal, revocation, all)");
-        option.setArgName("type");
-        options.addOption(option);
-
-        //pagination options
-        option = new Option(null, "start", true, "Page start");
-        option.setArgName("start");
-        options.addOption(option);
-
-        option = new Option(null, "size", true, "Page size");
-        option.setArgName("size");
-        options.addOption(option);
-
-        //search limits
-        option = new Option(null, "maxResults", true, "Maximum number of results");
-        option.setArgName("maxResults");
-        options.addOption(option);
-
-        option = new Option(null, "timeout", true, "Search timeout");
-        option.setArgName("maxTime");
-        options.addOption(option);
-    }
 }
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 85616a9..d36fb59 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestProfileFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestProfileFindCLI.java
@@ -1,5 +1,6 @@
 package com.netscape.cmstools.cert;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -19,14 +20,15 @@ public class CertRequestProfileFindCLI extends CLI {
     public CertRequestProfileFindCLI(CertCLI certCLI) {
         super("request-profile-find", "List Enrollment templates", certCLI);
         this.certCLI = certCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Profile ID>", options);
+        formatter.printHelp(getFullName() + " <Profile ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -34,6 +36,15 @@ public class CertRequestProfileFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -43,13 +54,15 @@ public class CertRequestProfileFindCLI extends CLI {
         } catch (ParseException e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: Missing Profile ID.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String s = cmd.getOptionValue("start");
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 396eca6..8b62670 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestProfileShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestProfileShowCLI.java
@@ -1,5 +1,7 @@
 package com.netscape.cmstools.cert;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.ParseException;
@@ -16,18 +18,29 @@ public class CertRequestProfileShowCLI extends CLI {
     public CertRequestProfileShowCLI(CertCLI certCLI) {
         super("request-profile-show", "Get Enrollment template", certCLI);
         this.certCLI = certCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Profile ID>", options);
+        formatter.printHelp(getFullName() + " <Profile ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-        CommandLine cmd = null;
-
+    public void createOptions() {
         Option option = new Option(null, "output", true, "Output filename");
         option.setArgName("filename");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
+        CommandLine cmd = null;
 
         try {
             cmd = parser.parse(options, args);
@@ -37,20 +50,15 @@ public class CertRequestProfileShowCLI extends CLI {
             System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
+        String[] cmdArgs = cmd.getArgs();
 
-        String[] cLineArgs = cmd.getArgs();
-        if (cLineArgs.length < 1) {
-            System.err.println("Error: Missing profile ID.");
+        if (cmdArgs.length < 1) {
+            System.err.println("Error: Missing Profile ID.");
             printHelp();
             System.exit(-1);
         }
 
-        String profileId = cLineArgs[0];
+        String profileId = cmdArgs[0];
 
         String filename = null;
         if (cmd.hasOption("output")) {
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 672b7b5..4a8221b 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestReviewCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestReviewCLI.java
@@ -32,6 +32,8 @@ public class CertRequestReviewCLI extends CLI {
     public CertRequestReviewCLI(CertCLI certCLI) {
         super("request-review", "Review certificate request", certCLI);
         this.certCLI = certCLI;
+
+        createOptions();
     }
 
     @Override
@@ -39,10 +41,7 @@ public class CertRequestReviewCLI extends CLI {
         formatter.printHelp(getFullName() + " <Request ID> [OPTIONS...]", options);
     }
 
-    @Override
-    public void execute(String[] args) throws Exception {
-        CommandLine cmd = null;
-
+    public void createOptions() {
         Option option = new Option(null, "action", true, "Action: " + StringUtils.join(actions, ", "));
         option.setArgName("action");
         options.addOption(option);
@@ -50,6 +49,18 @@ public class CertRequestReviewCLI extends CLI {
         option = new Option(null, "file", true, "File to store the certificate request");
         option.setArgName("filename");
         options.addOption(option);
+    }
+
+    @Override
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
+        CommandLine cmd = null;
 
         try {
             cmd = parser.parse(options, args);
@@ -59,24 +70,19 @@ public class CertRequestReviewCLI extends CLI {
             System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
+        String[] cmdArgs = cmd.getArgs();
 
-        String[] cLineArgs = cmd.getArgs();
-        if (cLineArgs.length < 1) {
-            System.err.println("Error: Missing certificate request ID.");
+        if (cmdArgs.length < 1) {
+            System.err.println("Error: Missing Certificate Request ID.");
             printHelp();
             System.exit(-1);
         }
 
         RequestId requestId = null;
         try {
-            requestId = new RequestId(cLineArgs[0]);
+            requestId = new RequestId(cmdArgs[0]);
         } catch (NumberFormatException e) {
-            System.err.println("Error: Invalid certificate request ID " + cLineArgs[0] + ".");
+            System.err.println("Error: Invalid certificate request ID " + cmdArgs[0] + ".");
             System.exit(-1);
         }
 
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 ca3ac44..aac18a6 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestShowCLI.java
@@ -1,5 +1,7 @@
 package com.netscape.cmstools.cert;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.ParseException;
 
@@ -13,19 +15,27 @@ public class CertRequestShowCLI extends CLI {
     CertCLI certCLI;
 
     public CertRequestShowCLI(CertCLI certCLI) {
+
         super("request-show", "Show certificate request", certCLI);
         this.certCLI = certCLI;
     }
 
     @Override
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Request ID>", options);
+        formatter.printHelp(getFullName() + " <Request ID> [OPTIONS...]", options);
     }
 
     @Override
     public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
         } catch (ParseException e) {
@@ -34,24 +44,19 @@ public class CertRequestShowCLI extends CLI {
             System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
+        String[] cmdArgs = cmd.getArgs();
 
-        String[] cLineArgs = cmd.getArgs();
-        if (cLineArgs.length < 1) {
-            System.err.println("Error: Missing certificate request ID.");
+        if (cmdArgs.length < 1) {
+            System.err.println("Error: Missing Certificate Request ID.");
             printHelp();
             System.exit(-1);
         }
 
         RequestId requestId = null;
         try {
-            requestId = new RequestId(cLineArgs[0]);
+            requestId = new RequestId(cmdArgs[0]);
         } catch (NumberFormatException e) {
-            System.err.println("Error: Invalid certificate request ID " + cLineArgs[0] + ".");
+            System.err.println("Error: Invalid certificate request ID " + cmdArgs[0] + ".");
             System.exit(-1);
         }
 
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 481a643..fe2b806 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRequestSubmitCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestSubmitCLI.java
@@ -2,6 +2,7 @@ package com.netscape.cmstools.cert;
 
 import java.io.File;
 import java.io.FileNotFoundException;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Scanner;
 
@@ -26,11 +27,18 @@ public class CertRequestSubmitCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <filename>", options);
+        formatter.printHelp(getFullName() + " <filename> [OPTIONS...]", options);
     }
 
     @Override
     public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         CommandLine cmd = null;
 
         try {
@@ -41,22 +49,16 @@ public class CertRequestSubmitCLI extends CLI {
             System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
-
-        String[] cLineArgs = cmd.getArgs();
+        String[] cmdArgs = cmd.getArgs();
 
-        if (cLineArgs.length < 1) {
+        if (cmdArgs.length < 1) {
             System.err.println("Error: No filename specified.");
             printHelp();
             System.exit(-1);
         }
 
         try {
-            CertEnrollmentRequest erd = getEnrollmentRequest(cLineArgs[0]);
+            CertEnrollmentRequest erd = getEnrollmentRequest(cmdArgs[0]);
             CertRequestInfos cri = certCLI.certClient.enrollRequest(erd);
             MainCLI.printMessage("Submitted certificate request");
             printRequestInformation(cri);
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 87d5869..afb0e03 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertRevokeCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRevokeCLI.java
@@ -20,6 +20,7 @@ package com.netscape.cmstools.cert;
 
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
+import java.util.Arrays;
 
 import netscape.security.x509.RevocationReason;
 
@@ -44,14 +45,15 @@ public class CertRevokeCLI extends CLI {
     public CertRevokeCLI(CertCLI certCLI) {
         super("revoke", "Revoke certificate", certCLI);
         this.certCLI = certCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <Serial Number> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         StringBuilder sb = new StringBuilder();
 
         for (RevocationReason reason : RevocationReason.INSTANCES) {
@@ -74,6 +76,15 @@ public class CertRevokeCLI extends CLI {
 
         options.addOption(null, "ca", false, "CA signing certificate");
         options.addOption(null, "force", false, "Force");
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -83,20 +94,15 @@ public class CertRevokeCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: Missing Serial Number.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         CertId certID = new CertId(cmdArgs[0]);
@@ -107,7 +113,7 @@ public class CertRevokeCLI extends CLI {
         if (reason == null) {
             System.err.println("Error: Invalid revocation reason: "+string);
             printHelp();
-            System.exit(1);
+            System.exit(-1);
             return;
         }
 
@@ -132,7 +138,7 @@ public class CertRevokeCLI extends CLI {
             BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
             String line = reader.readLine();
             if (!line.equalsIgnoreCase("Y")) {
-                System.exit(1);
+                System.exit(-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 d486742..febc4a4 100644
--- a/base/java-tools/src/com/netscape/cmstools/cert/CertShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertShowCLI.java
@@ -20,6 +20,7 @@ package com.netscape.cmstools.cert;
 
 import java.io.FileWriter;
 import java.io.PrintWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -39,20 +40,30 @@ public class CertShowCLI extends CLI {
     public CertShowCLI(CertCLI certCLI) {
         super("show", "Show certificate", certCLI);
         this.certCLI = certCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <Serial Number> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "output", true, "Output file");
         option.setArgName("file");
         options.addOption(option);
 
         options.addOption(null, "pretty", false, "Pretty print");
         options.addOption(null, "encoded", false, "Base-64 encoded");
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -62,25 +73,20 @@ public class CertShowCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
-
-        boolean showPrettyPrint = cmd.hasOption("pretty");
-        boolean showEncoded = cmd.hasOption("encoded");
-
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: Missing Serial Number.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
+        boolean showPrettyPrint = cmd.hasOption("pretty");
+        boolean showEncoded = cmd.hasOption("encoded");
+
         CertId certID = new CertId(cmdArgs[0]);
         String file = cmd.getOptionValue("output");
 
diff --git a/base/java-tools/src/com/netscape/cmstools/cli/HelpCLI.java b/base/java-tools/src/com/netscape/cmstools/cli/HelpCLI.java
index c2468f5..6b2a123 100644
--- a/base/java-tools/src/com/netscape/cmstools/cli/HelpCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cli/HelpCLI.java
@@ -46,7 +46,7 @@ public class HelpCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
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 f4511b9..9943d18 100644
--- a/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java
@@ -78,6 +78,8 @@ public class MainCLI extends CLI {
         addModule(new OCSPCLI(this));
         addModule(new TKSCLI(this));
         addModule(new TPSCLI(this));
+
+        createOptions();
     }
 
     public String getFullModuleName(String moduleName) {
@@ -113,7 +115,7 @@ public class MainCLI extends CLI {
         }
     }
 
-    public void createOptions(Options options) throws UnknownHostException {
+    public void createOptions() throws UnknownHostException {
 
         Option option = new Option("U", true, "Server URI");
         option.setArgName("uri");
@@ -303,8 +305,6 @@ public class MainCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
-        createOptions(options);
-
         CommandLine cmd;
         try {
             cmd = parser.parse(options, args, true);
@@ -363,7 +363,7 @@ public class MainCLI extends CLI {
             } else {
                 System.err.println(t.getClass().getSimpleName()+": "+t.getMessage());
             }
-            System.exit(1);
+            System.exit(-1);
         }
     }
 }
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 12dde44..6d0bb62 100644
--- a/base/java-tools/src/com/netscape/cmstools/client/ClientCertFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/client/ClientCertFindCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.client;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.mozilla.jss.crypto.X509Certificate;
 
@@ -34,30 +36,43 @@ public class ClientCertFindCLI extends CLI {
     public ClientCertFindCLI(ClientCLI clientCLI) {
         super("cert-find", "Find certificates in client security database", clientCLI);
         this.clientCLI = clientCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS]", options);
+        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         options.addOption(null, "ca", false, "Find CA certificates only");
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
 
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         client = parent.getClient();
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 185e241..e5b07b3 100644
--- a/base/java-tools/src/com/netscape/cmstools/client/ClientCertImportCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/client/ClientCertImportCLI.java
@@ -20,6 +20,7 @@ package com.netscape.cmstools.client;
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -39,14 +40,15 @@ public class ClientCertImportCLI extends CLI {
     public ClientCertImportCLI(ClientCLI clientCLI) {
         super("cert-import", "Import certificate into client security database", clientCLI);
         this.clientCLI = clientCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS]", options);
+        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "cert", true, "Import certificate file");
         option.setArgName("path");
         options.addOption(option);
@@ -56,6 +58,15 @@ public class ClientCertImportCLI extends CLI {
         options.addOption(option);
 
         options.addOption(null, "ca-server", false, "Import CA certificate from CA server");
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -65,13 +76,15 @@ public class ClientCertImportCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         client = parent.getClient();
@@ -108,14 +121,14 @@ public class ClientCertImportCLI extends CLI {
         } else {
             System.err.println("Error: Missing certificate to import");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         MainCLI mainCLI = (MainCLI)parent.getParent();
 
         if (mainCLI.config.getCertNickname() == null) {
             System.err.println("Error: Certificate nickname is required.");
-            System.exit(1);
+            System.exit(-1);
         }
 
         File certDatabase = mainCLI.certDatabase;
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 70ada90..03743f6 100644
--- a/base/java-tools/src/com/netscape/cmstools/client/ClientCertRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/client/ClientCertRemoveCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.client;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 
 import com.netscape.cmstools.cli.CLI;
@@ -36,32 +38,34 @@ public class ClientCertRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <nickname>", options);
+        formatter.printHelp(getFullName() + " <nickname> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
 
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No nickname specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         client = parent.getClient();
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 50a39ac..bcce878 100644
--- a/base/java-tools/src/com/netscape/cmstools/client/ClientInitCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/client/ClientInitCLI.java
@@ -23,6 +23,7 @@ import java.io.File;
 import java.io.FileWriter;
 import java.io.InputStreamReader;
 import java.io.PrintWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.io.FileUtils;
@@ -37,15 +38,25 @@ public class ClientInitCLI extends CLI {
 
     public ClientInitCLI(ClientCLI clientCLI) {
         super("init", "Initialize client security database", clientCLI);
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS]", options);
+        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         options.addOption(null, "force", false, "Force database initialization.");
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -55,20 +66,22 @@ public class ClientInitCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         MainCLI mainCLI = (MainCLI)parent.getParent();
 
         if (mainCLI.config.getCertPassword() == null) {
             System.err.println("Error: Security database password is required.");
-            System.exit(1);
+            System.exit(-1);
         }
 
         boolean force = cmd.hasOption("force");
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 4fd7808..6d824fe 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupAddCLI.java
@@ -37,26 +37,29 @@ public class GroupAddCLI extends CLI {
     public GroupAddCLI(GroupCLI groupCLI) {
         super("add", "Add group", groupCLI);
         this.groupCLI = groupCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Group ID> [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " <Group ID> --description <Description> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
+    public void createOptions() {
+        Option option = new Option(null, "description", true, "Description");
+        option.setArgName("description");
+        option.setRequired(true);
+        options.addOption(option);
+    }
 
-        // Check for "--help" prior to parsing due to required option
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
         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);
-        options.addOption(option);
-
         CommandLine cmd = null;
 
         try {
@@ -65,14 +68,15 @@ public class GroupAddCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Group ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String groupID = cmdArgs[0];
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 8cb54b1..3c340d8 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupFindCLI.java
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.group;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -38,14 +39,15 @@ public class GroupFindCLI extends CLI {
     public GroupFindCLI(GroupCLI groupCLI) {
         super("find", "Find groups", groupCLI);
         this.groupCLI = groupCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [FILTER] [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -53,6 +55,15 @@ public class GroupFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -62,13 +73,7 @@ public class GroupFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
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 ec01cbb..5c3e5b4 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupMemberAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupMemberAddCLI.java
@@ -20,6 +20,8 @@ package com.netscape.cmstools.group;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.certsrv.group.GroupMemberData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -37,21 +39,34 @@ public class GroupMemberAddCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Group ID> <Member ID>", options);
+        formatter.printHelp(getFullName() + " <Group ID> <Member ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help" prior to parsing due to required option
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 2) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 2) {
+            System.err.println("Error: Insufficient number of arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String groupID = args[0];
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 b5100e3..41f310a 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupMemberFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupMemberFindCLI.java
@@ -39,21 +39,15 @@ public class GroupMemberFindCLI extends CLI {
     public GroupMemberFindCLI(GroupMemberCLI groupMemberCLI) {
         super("find", "Find group members", groupMemberCLI);
         this.groupMemberCLI = groupMemberCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <Group ID> [OPTIONS...]", options);
     }
 
-    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);
-        }
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -61,6 +55,15 @@ public class GroupMemberFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -70,20 +73,15 @@ public class GroupMemberFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Group ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String groupID = cmdArgs[0];
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 8947b5f..fbffb68 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupMemberRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupMemberRemoveCLI.java
@@ -20,6 +20,8 @@ package com.netscape.cmstools.group;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -36,21 +38,34 @@ public class GroupMemberRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Group ID> <Member ID>", options);
+        formatter.printHelp(getFullName() + " <Group ID> <Member ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help" prior to parsing due to required option
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 2) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 2) {
+            System.err.println("Error: Insufficient number of arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String groupID = args[0];
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 4e10c33..e171336 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupMemberShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupMemberShowCLI.java
@@ -20,6 +20,8 @@ package com.netscape.cmstools.group;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.certsrv.group.GroupMemberData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -37,21 +39,34 @@ public class GroupMemberShowCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Group ID> <Member ID>", options);
+        formatter.printHelp(getFullName() + " <Group ID> <Member ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help" prior to parsing due to required option
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 2) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 2) {
+            System.err.println("Error: Insufficient number of arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String groupID = args[0];
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 f7c522b..e26a63b 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupModifyCLI.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;
 
@@ -35,17 +37,27 @@ public class GroupModifyCLI extends CLI {
     public GroupModifyCLI(GroupCLI groupCLI) {
         super("mod", "Modify group", groupCLI);
         this.groupCLI = groupCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <Group ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "description", true, "Description");
         option.setArgName("description");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -55,20 +67,15 @@ public class GroupModifyCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Group ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String groupID = cmdArgs[0];
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 e27f8d5..0fd7d2f 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupRemoveCLI.java
@@ -20,6 +20,8 @@ package com.netscape.cmstools.group;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -37,21 +39,34 @@ public class GroupRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Group ID>", options);
+        formatter.printHelp(getFullName() + " <Group ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Group ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String groupID = args[0];
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 9f61766..0030c08 100644
--- a/base/java-tools/src/com/netscape/cmstools/group/GroupShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupShowCLI.java
@@ -20,6 +20,8 @@ package com.netscape.cmstools.group;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.certsrv.group.GroupData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -37,21 +39,34 @@ public class GroupShowCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Group ID>", options);
+        formatter.printHelp(getFullName() + " <Group ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Group ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String groupID = args[0];
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 49ffe71..d9bdd88 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyArchiveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyArchiveCLI.java
@@ -2,6 +2,7 @@ package com.netscape.cmstools.key;
 
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.util.Arrays;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
@@ -23,14 +24,15 @@ public class KeyArchiveCLI extends CLI {
     public KeyArchiveCLI(KeyCLI keyCLI) {
         super("archive", "Archive a secret in the DRM.", keyCLI);
         this.keyCLI = keyCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS]", options);
+        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) {
-
+    public void createOptions() {
         Option option = new Option(null, "clientKeyID", true, "Unique client key identifier.");
         option.setArgName("Client Key Identifier");
         options.addOption(option);
@@ -43,21 +45,33 @@ public class KeyArchiveCLI extends CLI {
                 "Location of the request template file.\nUsed for archiving already encrypted data.");
         option.setArgName("Input file path");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
 
         } catch (ParseException e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String requestFile = cmd.getOptionValue("input");
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 43310aa..73bad6b 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.key;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -39,14 +40,15 @@ public class KeyFindCLI extends CLI {
     public KeyFindCLI(KeyCLI keyCLI) {
         super("find", "Find keys", keyCLI);
         this.keyCLI = keyCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) {
-
+    public void createOptions() {
         Option option = new Option(null, "client", true, "Client ID");
         option.setArgName("client ID");
         options.addOption(option);
@@ -70,6 +72,15 @@ public class KeyFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -79,13 +90,15 @@ public class KeyFindCLI extends CLI {
         } catch (ParseException e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         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 3a2aa86..a551d61 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyGenerateCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyGenerateCLI.java
@@ -18,21 +18,15 @@ public class KeyGenerateCLI extends CLI {
     public KeyGenerateCLI(KeyCLI keyCLI) {
         super("generate", "Generate key", keyCLI);
         this.keyCLI = keyCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Client Key ID> [OPTIONS]", options);
+        formatter.printHelp(getFullName() + " <Client Key ID> --key-algorithm <algorithm> [OPTIONS...]", options);
     }
 
-    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);
-        }
-
+    public void createOptions() {
         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");
@@ -52,22 +46,33 @@ public class KeyGenerateCLI extends CLI {
                 + "\nValid values: wrap, unwrap, sign, verify, encrypt, decrypt.");
         option.setArgName("list of usages");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
 
         } catch (ParseException e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
+
         if (cmdArgs.length < 1) {
-            System.err.println("Error: Missing the Client Key Id");
+            System.err.println("Error: Missing Client Key Id.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String clientKeyId = cmdArgs[0];
@@ -88,11 +93,11 @@ public class KeyGenerateCLI extends CLI {
             case KeyRequestResource.RC2_ALGORITHM:
                 System.err.println("Error: Key size must be specified for the algorithm used.");
                 printHelp();
-                System.exit(1);
+                System.exit(-1);
             default:
                 System.err.println("Error: Algorithm not supported.");
                 printHelp();
-                System.exit(1);
+                System.exit(-1);
             }
         }
         List<String> usages = null;
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 4378080..b16bc41 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyModifyCLI.java
@@ -34,48 +34,50 @@ public class KeyModifyCLI extends CLI {
     public KeyModifyCLI(KeyCLI keyCLI) {
         super("mod", "Modify the status of a key", keyCLI);
         this.keyCLI = keyCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Key ID> [OPTIONS]", options);
+        formatter.printHelp(getFullName() + " <Key ID> --status <status> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) {
+    public void createOptions() {
+        Option option = new Option(null, "status", true, "Status of the key.\nValid values: active, inactive");
+        option.setRequired(true);
+        option.setArgName("status");
+        options.addOption(option);
+    }
 
-        // Check for "--help" prior to parsing due to required option
+    public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
         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");
-        options.addOption(option);
-
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
 
         } catch (ParseException e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        String status = cmd.getOptionValue("status");
-        if (status == null) {
-            System.out.println("No status:: " + status);
-            printHelp();
             System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
+
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Key ID specified.");
             printHelp();
             System.exit(-1);
         }
+
+        String status = cmd.getOptionValue("status");
+
         KeyId keyId = new KeyId(cmdArgs[0]);
 
         keyCLI.keyClient.modifyKeyStatus(keyId, 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 cdaf6b6..5077330 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyRecoverCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyRecoverCLI.java
@@ -2,6 +2,7 @@ package com.netscape.cmstools.key;
 
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.util.Arrays;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
@@ -24,14 +25,15 @@ public class KeyRecoverCLI extends CLI {
     public KeyRecoverCLI(KeyCLI keyCLI) {
         super("recover", "Create a key recovery request", keyCLI);
         this.keyCLI = keyCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS]", options);
+        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) {
-
+    public void createOptions() {
         Option option = new Option(null, "keyID", true, "Key Identifier for the secret to be recovered.");
         option.setArgName("Key Identifier");
         options.addOption(option);
@@ -39,21 +41,33 @@ public class KeyRecoverCLI extends CLI {
         option = new Option(null, "input", true, "Location of the request template file.");
         option.setArgName("Input file path");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
 
         } catch (ParseException e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String requestFile = cmd.getOptionValue("input");
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 2045104..92c98f0 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.key;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -40,14 +41,15 @@ public class KeyRequestFindCLI extends CLI {
     public KeyRequestFindCLI(KeyCLI keyCLI) {
         super("request-find", "Find key requests", keyCLI);
         this.keyCLI = keyCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) {
-
+    public void createOptions() {
         Option option = new Option(null, "status", true, "Request status");
         option.setArgName("status");
         options.addOption(option);
@@ -75,6 +77,15 @@ public class KeyRequestFindCLI extends CLI {
         option = new Option(null, "pageSize", true, "Page size");
         option.setArgName("page size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -84,13 +95,15 @@ public class KeyRequestFindCLI extends CLI {
         } catch (ParseException e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         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 5464625..797e2c2 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestReviewCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestReviewCLI.java
@@ -17,43 +17,49 @@ public class KeyRequestReviewCLI extends CLI {
     public KeyRequestReviewCLI(KeyCLI keyCLI) {
         super("request-review", "Review key request", keyCLI);
         this.keyCLI = keyCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Request ID> [OPTIONS]", options);
+        formatter.printHelp(getFullName() + " <Request ID> --action <action> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) {
+    public void createOptions() {
+        Option option = new Option(null, "action", true,
+                "Action to be performed on the request.\nValid values: approve, reject, cancel.");
+        option.setArgName("Action to perform");
+        option.setRequired(true);
+        options.addOption(option);
+    }
 
-        // Check for "--help" prior to parsing due to required option
+    public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
         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");
-        option.setRequired(true);
-        options.addOption(option);
-
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
 
         } catch (ParseException e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
+
         if (cmdArgs.length != 1) {
-            System.err.println("Error: Invalid arguments provided.");
+            System.err.println("Error: Insufficient number of arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
+
         RequestId reqId = new RequestId(cmdArgs[0]);
 
         String action = cmd.getOptionValue("action");
@@ -70,7 +76,7 @@ public class KeyRequestReviewCLI extends CLI {
         default:
             System.err.println("Error: Invalid action.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         KeyRequestInfo keyRequestInfo = keyCLI.keyClient.getRequestInfo(reqId);
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 0459fa7..fe3ef14 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestShowCLI.java
@@ -37,7 +37,7 @@ public class KeyRequestShowCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Request ID>", options);
+        formatter.printHelp(getFullName() + " <Request ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) {
@@ -49,18 +49,23 @@ public class KeyRequestShowCLI extends CLI {
             System.exit(0);
         }
 
-        if (args.length != 1) {
-            printHelp();
-            System.exit(-1);
-        }
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
 
         } catch (ParseException e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Request ID specified.");
+            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 095595f..534a6e8 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyRetrieveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyRetrieveCLI.java
@@ -3,6 +3,7 @@ package com.netscape.cmstools.key;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.util.Arrays;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
@@ -27,14 +28,15 @@ public class KeyRetrieveCLI extends CLI {
     public KeyRetrieveCLI(KeyCLI keyCLI) {
         super("retrieve", "Retrieve key", keyCLI);
         this.keyCLI = keyCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS]", options);
+        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) {
-
+    public void createOptions() {
         Option option = new Option(null, "keyID", true, "Key Identifier for the secret to be recovered.");
         option.setArgName("Key Identifier");
         options.addOption(option);
@@ -50,25 +52,37 @@ public class KeyRetrieveCLI extends CLI {
         option = new Option(null, "output", true, "Location to store the retrieved key information");
         option.setArgName("File path to store key information");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
 
         } catch (ParseException e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         if(cmd.getOptions().length==0){
-            System.err.println("Error: Insufficient parameters provided.");
+            System.err.println("Error: Insufficient number of parameters provided.");
             printHelp();
             System.exit(-1);
         }
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 172f249..4e1c50d 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyShowCLI.java
@@ -37,30 +37,34 @@ public class KeyShowCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Key ID>", options);
+        formatter.printHelp(getFullName() + " <Key ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
-            printHelp();
-            System.exit(-1);
-        }
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
 
         } catch (ParseException e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Key ID specified.");
+            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 5fc869d..0e76d4f 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateFindCLI.java
@@ -3,6 +3,7 @@ package com.netscape.cmstools.key;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.util.ArrayList;
+import java.util.Arrays;
 
 import javax.xml.bind.JAXBException;
 
@@ -26,25 +27,34 @@ public class KeyTemplateFindCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS]", options);
+        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
     public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
 
         } catch (ParseException e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         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 6e73652..77d0680 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateShowCLI.java
@@ -22,27 +22,30 @@ public class KeyTemplateShowCLI extends CLI {
     public KeyTemplateShowCLI(KeyCLI keyCLI) {
         super("template-show", "Get request template", keyCLI);
         this.keyCLI = keyCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName()
-                + " <Template ID> [OPTIONS]", options);
+        formatter.printHelp(getFullName() + " <Template ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) {
+    public void createOptions() {
+        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);
+    }
 
-        // Check for "--help"
+    public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
         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);
-
         CommandLine cmd = null;
+
         try {
             cmd = parser.parse(options, args);
         } catch (ParseException e) {
@@ -52,7 +55,9 @@ public class KeyTemplateShowCLI extends CLI {
         }
 
         String[] cmdArgs = cmd.getArgs();
+
         if (cmdArgs.length < 1) {
+            System.err.println("Error: No Template ID specified.");
             printHelp();
             System.exit(-1);
         }
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 705c7b7..8020b84 100644
--- a/base/java-tools/src/com/netscape/cmstools/logging/ActivityFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/logging/ActivityFindCLI.java
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.logging;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -38,14 +39,15 @@ public class ActivityFindCLI extends CLI {
     public ActivityFindCLI(ActivityCLI activityCLI) {
         super("find", "Find activities", activityCLI);
         this.activityCLI = activityCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [FILTER] [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -53,6 +55,15 @@ public class ActivityFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -62,13 +73,7 @@ public class ActivityFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
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 091cf36..ea0d69f 100644
--- a/base/java-tools/src/com/netscape/cmstools/logging/ActivityShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/logging/ActivityShowCLI.java
@@ -20,6 +20,8 @@ package com.netscape.cmstools.logging;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.certsrv.logging.ActivityData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -37,21 +39,34 @@ public class ActivityShowCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Activity ID>", options);
+        formatter.printHelp(getFullName() + " <Activity ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Activity ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String activityID = args[0];
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 26411d1..a69eeb5 100644
--- a/base/java-tools/src/com/netscape/cmstools/logging/AuditModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/logging/AuditModifyCLI.java
@@ -43,21 +43,15 @@ public class AuditModifyCLI extends CLI {
     public AuditModifyCLI(AuditCLI auditCLI) {
         super("mod", "Modify audit configuration", auditCLI);
         this.auditCLI = auditCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    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);
-        }
-
+    public void createOptions() {
         Option option = new Option(null, "action", true, "Action: update (default), enable, disable.");
         option.setArgName("action");
         options.addOption(option);
@@ -69,6 +63,15 @@ public class AuditModifyCLI extends CLI {
         option = new Option(null, "output", true, "Output file to store audit configuration.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -78,14 +81,15 @@ public class AuditModifyCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String action = cmd.getOptionValue("action", "update");
@@ -99,7 +103,7 @@ public class AuditModifyCLI extends CLI {
             if (input == null) {
                 System.err.println("Error: Input file is required.");
                 printHelp();
-                System.exit(1);
+                System.exit(-1);
             }
 
             try (BufferedReader in = new BufferedReader(new FileReader(input));
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 f82510e..34f708c 100644
--- a/base/java-tools/src/com/netscape/cmstools/logging/AuditShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/logging/AuditShowCLI.java
@@ -20,6 +20,7 @@ package com.netscape.cmstools.logging;
 
 import java.io.FileWriter;
 import java.io.PrintWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -38,17 +39,27 @@ public class AuditShowCLI extends CLI {
     public AuditShowCLI(AuditCLI auditCLI) {
         super("show", "Show audit configuration", auditCLI);
         this.auditCLI = auditCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName(), options);
+        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "output", true, "Output file to store audit configuration.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -58,20 +69,15 @@ public class AuditShowCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String output = cmd.getOptionValue("output");
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 698b15e..62bd145 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileAddCLI.java
@@ -1,6 +1,7 @@
 package com.netscape.cmstools.profile;
 
 import java.io.FileNotFoundException;
+import java.util.Arrays;
 
 import javax.xml.bind.JAXBException;
 
@@ -21,10 +22,17 @@ public class ProfileAddCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <file>", options);
+        formatter.printHelp(getFullName() + " <file> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         CommandLine cmd = null;
 
         try {
@@ -35,20 +43,15 @@ public class ProfileAddCLI extends CLI {
             System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
+        String[] cmdArgs = cmd.getArgs();
 
-        String[] cLineArgs = cmd.getArgs();
-
-        if (cLineArgs.length < 1) {
+        if (cmdArgs.length < 1) {
             System.err.println("Error: No filename specified.");
             printHelp();
             System.exit(-1);
         }
-        String filename = cLineArgs[0];
+
+        String filename = cmdArgs[0];
         if (filename == null || filename.trim().length() == 0) {
             System.err.println("Error: Missing input file name.");
             printHelp();
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 8711bfd..7e7f50f 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileDisableCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileDisableCLI.java
@@ -2,6 +2,8 @@ package com.netscape.cmstools.profile;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -15,21 +17,34 @@ public class ProfileDisableCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Profile ID>", options);
+        formatter.printHelp(getFullName() + " <Profile ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Profile ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String profileId = args[0];
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 099c24a..73157c2 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileEnableCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileEnableCLI.java
@@ -2,6 +2,8 @@ package com.netscape.cmstools.profile;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -15,21 +17,34 @@ public class ProfileEnableCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Profile ID>", options);
+        formatter.printHelp(getFullName() + " <Profile ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Profile ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String profileId = args[0];
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 bbadca6..9552fd7 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileFindCLI.java
@@ -1,5 +1,6 @@
 package com.netscape.cmstools.profile;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -17,14 +18,15 @@ public class ProfileFindCLI extends CLI {
     public ProfileFindCLI(ProfileCLI profileCLI) {
         super("find", "Find profiles", profileCLI);
         this.profileCLI = profileCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [FILTER] [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -32,6 +34,15 @@ public class ProfileFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -41,13 +52,15 @@ public class ProfileFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String s = cmd.getOptionValue("start");
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 00c557d..bbeb919 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileModifyCLI.java
@@ -1,6 +1,7 @@
 package com.netscape.cmstools.profile;
 
 import java.io.FileNotFoundException;
+import java.util.Arrays;
 
 import javax.xml.bind.JAXBException;
 
@@ -21,10 +22,17 @@ public class ProfileModifyCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <file>", options);
+        formatter.printHelp(getFullName() + " <file> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
         CommandLine cmd = null;
 
         try {
@@ -35,20 +43,15 @@ public class ProfileModifyCLI extends CLI {
             System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
+        String[] cmdArgs = cmd.getArgs();
 
-        String[] cLineArgs = cmd.getArgs();
-
-        if (cLineArgs.length < 1) {
+        if (cmdArgs.length < 1) {
             System.err.println("Error: No filename specified.");
             printHelp();
             System.exit(-1);
         }
-        String filename = cLineArgs[0];
+
+        String filename = cmdArgs[0];
         if (filename == null || filename.trim().length() == 0) {
             System.err.println("Error: Missing input file name.");
             printHelp();
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 f23113f..b9f5aa6 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileRemoveCLI.java
@@ -2,6 +2,8 @@ package com.netscape.cmstools.profile;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -15,21 +17,34 @@ public class ProfileRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Profile ID>", options);
+        formatter.printHelp(getFullName() + " <Profile ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Profile ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String profileId = args[0];
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 64161b8..f5b636c 100644
--- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileShowCLI.java
@@ -1,5 +1,7 @@
 package com.netscape.cmstools.profile;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.ParseException;
@@ -15,18 +17,29 @@ public class ProfileShowCLI extends CLI {
     public ProfileShowCLI(ProfileCLI profileCLI) {
         super("show", "Show profiles", profileCLI);
         this.profileCLI = profileCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Profile ID>", options);
+        formatter.printHelp(getFullName() + " <Profile ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-        CommandLine cmd = null;
-
+    public void createOptions() {
         Option option = new Option(null, "output", true, "Output filename");
         option.setArgName("filename");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
+
+        CommandLine cmd = null;
 
         try {
             cmd = parser.parse(options, args);
@@ -36,20 +49,15 @@ public class ProfileShowCLI extends CLI {
             System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
+        String[] cmdArgs = cmd.getArgs();
 
-        String[] cLineArgs = cmd.getArgs();
-        if (cLineArgs.length < 1) {
-            System.err.println("Error: Missing profile ID.");
+        if (cmdArgs.length < 1) {
+            System.err.println("Error: No Profile ID specified.");
             printHelp();
             System.exit(-1);
         }
 
-        String profileId = cLineArgs[0];
+        String profileId = cmdArgs[0];
 
         String filename = null;
         if (cmd.hasOption("output")) {
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 22289da..2ac631d 100644
--- a/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestFindCLI.java
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.selftests;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -38,14 +39,15 @@ public class SelfTestFindCLI extends CLI {
     public SelfTestFindCLI(SelfTestCLI selfTestCLI) {
         super("find", "Find selftests", selfTestCLI);
         this.selfTestCLI = selfTestCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [FILTER] [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -53,6 +55,15 @@ public class SelfTestFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -62,13 +73,7 @@ public class SelfTestFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
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 bb80cfc..a382717 100644
--- a/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestRunCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestRunCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.selftests;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 
 import com.netscape.cmstools.cli.CLI;
@@ -36,10 +38,16 @@ public class SelfTestRunCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName(), options);
+        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -49,20 +57,15 @@ public class SelfTestRunCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         selfTestCLI.selfTestClient.executeSelfTests("run");
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 f579c1f..56ff889 100644
--- a/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/selftests/SelfTestShowCLI.java
@@ -20,6 +20,7 @@ package com.netscape.cmstools.selftests;
 
 import java.io.FileWriter;
 import java.io.PrintWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -38,17 +39,27 @@ public class SelfTestShowCLI extends CLI {
     public SelfTestShowCLI(SelfTestCLI selfTestCLI) {
         super("show", "Show selftest", selfTestCLI);
         this.selfTestCLI = selfTestCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <SelfTest ID>", options);
+        formatter.printHelp(getFullName() + " <SelfTest ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "output", true, "Output file to store selfTest properties.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -58,20 +69,15 @@ public class SelfTestShowCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No SelfTest ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String selfTestID = args[0];
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 d3ddd56..aa92bee 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/KRAConnectorAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/KRAConnectorAddCLI.java
@@ -18,6 +18,7 @@
 package com.netscape.cmstools.system;
 
 import java.io.FileInputStream;
+import java.util.Arrays;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.Unmarshaller;
@@ -42,10 +43,16 @@ public class KRAConnectorAddCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <File Name>", options);
+        formatter.printHelp(getFullName() + " <File Name> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -57,21 +64,15 @@ public class KRAConnectorAddCLI extends CLI {
             System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
-
-        String[] cLineArgs = cmd.getArgs();
+        String[] cmdArgs = cmd.getArgs();
 
-        if (cLineArgs.length < 1) {
+        if (cmdArgs.length < 1) {
             System.err.println("Error: No file name specified.");
             printHelp();
             System.exit(-1);
         }
 
-        FileInputStream fis = new FileInputStream(cLineArgs[0].trim());
+        FileInputStream fis = new FileInputStream(cmdArgs[0].trim());
 
         JAXBContext context = JAXBContext.newInstance(KRAConnectorInfo.class);
         Unmarshaller unmarshaller = context.createUnmarshaller();
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 ccd2cae..873cb47 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/KRAConnectorRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/KRAConnectorRemoveCLI.java
@@ -19,6 +19,8 @@ package com.netscape.cmstools.system;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -35,21 +37,34 @@ public class KRAConnectorRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <KRA Host> <KRA Port>", options);
+        formatter.printHelp(getFullName() + " <KRA Host> <KRA Port> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 2) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 2) {
+            System.err.println("Error: Insufficient number of arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String kraHost = args[0];
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 d7fb4b1..86e722a 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/SecurityDomainGetInstallTokenCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/SecurityDomainGetInstallTokenCLI.java
@@ -38,21 +38,15 @@ public class SecurityDomainGetInstallTokenCLI extends CLI {
     public SecurityDomainGetInstallTokenCLI(SecurityDomainCLI securityDomainCLI) {
         super("get-install-token", "Get install token", securityDomainCLI);
         this.securityDomainCLI = securityDomainCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " --subsystem <subsystem> [OPTIONS...]", options);
     }
 
-    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);
-        }
-
+    public void createOptions() {
         Option option = new Option(null, "hostname", true, "Hostname");
         option.setArgName("hostname");
         options.addOption(option);
@@ -61,6 +55,15 @@ public class SecurityDomainGetInstallTokenCLI extends CLI {
         option.setArgName("subsystem");
         option.setRequired(true);
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -70,14 +73,15 @@ public class SecurityDomainGetInstallTokenCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String hostname = cmd.getOptionValue("hostname");
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 a23bc52..dd6c920 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/SecurityDomainShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/SecurityDomainShowCLI.java
@@ -18,6 +18,8 @@
 
 package com.netscape.cmstools.system;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 
 import com.netscape.certsrv.system.DomainInfo;
@@ -36,10 +38,16 @@ public class SecurityDomainShowCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName(), options);
+        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -49,20 +57,15 @@ public class SecurityDomainShowCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         DomainInfo domain = securityDomainCLI.securityDomainClient.getDomainInfo();
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 fdf9ce8..ceeccdf 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorAddCLI.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;
 
@@ -32,13 +34,15 @@ public class TPSConnectorAddCLI extends CLI {
     public TPSConnectorAddCLI(TPSConnectorCLI tpsConnectorCLI) {
         super("add", "Add TPS connector to TKS", tpsConnectorCLI);
         this.tpsConnectorCLI = tpsConnectorCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
+    public void createOptions() {
         Option option = new Option(null, "host", true, "TPS host");
         option.setArgName("host");
         options.addOption(option);
@@ -46,6 +50,15 @@ public class TPSConnectorAddCLI extends CLI {
         option = new Option(null, "port", true, "TPS port");
         option.setArgName("port");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -55,13 +68,15 @@ public class TPSConnectorAddCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String tpsHost = cmd.getOptionValue("host");
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 d69232b..bdff056 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorFindCLI.java
@@ -17,6 +17,7 @@
 // --- END COPYRIGHT BLOCK ---
 package com.netscape.cmstools.system;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -37,14 +38,15 @@ public class TPSConnectorFindCLI extends CLI {
     public TPSConnectorFindCLI(TPSConnectorCLI tpsConnectorCLI) {
         super("find", "Find TPS connectors on TKS", tpsConnectorCLI);
         this.tpsConnectorCLI = tpsConnectorCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -52,6 +54,15 @@ public class TPSConnectorFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -61,13 +72,15 @@ public class TPSConnectorFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String s = cmd.getOptionValue("start");
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 e098f5b..f9de2ab 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorModCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorModCLI.java
@@ -1,5 +1,7 @@
 package com.netscape.cmstools.system;
 
+import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
@@ -13,13 +15,15 @@ public class TPSConnectorModCLI extends CLI {
     public TPSConnectorModCLI(TPSConnectorCLI tpsConnectorCLI) {
         super("mod", "Modify TPS connector on TKS", tpsConnectorCLI);
         this.tpsConnectorCLI = tpsConnectorCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <Connector ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
+    public void createOptions() {
         Option option = new Option(null, "host", true, "TPS host");
         option.setArgName("host");
         options.addOption(option);
@@ -27,6 +31,15 @@ public class TPSConnectorModCLI extends CLI {
         option = new Option(null, "port", true, "TPS port");
         option.setArgName("port");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -36,19 +49,15 @@ public class TPSConnectorModCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
+
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Connector ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String connID = cmdArgs[0];
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 d440814..e8355de 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorRemoveCLI.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;
 
@@ -32,13 +34,15 @@ public class TPSConnectorRemoveCLI extends CLI {
     public TPSConnectorRemoveCLI(TPSConnectorCLI tpsConnectorCLI) {
         super("del", "Remove TPS connector from TKS", tpsConnectorCLI);
         this.tpsConnectorCLI = tpsConnectorCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
+    public void createOptions() {
         Option option = new Option(null, "host", true, "TPS host");
         option.setArgName("host");
         options.addOption(option);
@@ -46,6 +50,15 @@ public class TPSConnectorRemoveCLI extends CLI {
         option = new Option(null, "port", true, "TPS port");
         option.setArgName("port");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -55,13 +68,15 @@ public class TPSConnectorRemoveCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
-        if (cmd.hasOption("help")) {
-            // Display usage
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String tpsHost = cmd.getOptionValue("host");
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 03a5606..2c2cb18 100644
--- a/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/system/TPSConnectorShowCLI.java
@@ -36,21 +36,15 @@ public class TPSConnectorShowCLI extends CLI {
     public TPSConnectorShowCLI(TPSConnectorCLI tpsConnectorCLI) {
         super("show", "Show TPS connector details on TKS", tpsConnectorCLI);
         this.tpsConnectorCLI = tpsConnectorCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " --host <host> [OPTIONS...]", options);
     }
 
-    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);
-        }
-
+    public void createOptions() {
         Option option = new Option(null, "host", true, "TPS host");
         option.setArgName("host");
         option.setRequired(true);
@@ -59,6 +53,15 @@ public class TPSConnectorShowCLI extends CLI {
         option = new Option(null, "port", true, "TPS port");
         option.setArgName("port");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -68,7 +71,15 @@ public class TPSConnectorShowCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
+            printHelp();
+            System.exit(-1);
         }
 
         String tpsHost = cmd.getOptionValue("host");
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 43a58c8..5247509 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
@@ -41,26 +41,29 @@ public class AuthenticatorAddCLI extends CLI {
     public AuthenticatorAddCLI(AuthenticatorCLI authenticatorCLI) {
         super("add", "Add authenticator", authenticatorCLI);
         this.authenticatorCLI = authenticatorCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " --input <file> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
+    public void createOptions() {
+        Option option = new Option(null, "input", true, "Input file containing authenticator properties.");
+        option.setArgName("file");
+        option.setRequired(true);
+        options.addOption(option);
+    }
 
-        // Check for "--help" prior to parsing due to required option
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
         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);
-        options.addOption(option);
-
         CommandLine cmd = null;
 
         try {
@@ -69,14 +72,15 @@ public class AuthenticatorAddCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String input = cmd.getOptionValue("input");
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 4441bcd..58532de 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
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.tps.authenticator;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -38,14 +39,15 @@ public class AuthenticatorFindCLI extends CLI {
     public AuthenticatorFindCLI(AuthenticatorCLI authenticatorCLI) {
         super("find", "Find authenticators", authenticatorCLI);
         this.authenticatorCLI = authenticatorCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [FILTER] [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -53,6 +55,15 @@ public class AuthenticatorFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -62,13 +73,7 @@ public class AuthenticatorFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
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 10e2a5e..410f0b7 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
@@ -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;
@@ -40,14 +41,15 @@ public class AuthenticatorModifyCLI extends CLI {
     public AuthenticatorModifyCLI(AuthenticatorCLI authenticatorCLI) {
         super("mod", "Modify authenticator", authenticatorCLI);
         this.authenticatorCLI = authenticatorCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <Authenticator ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "action", true, "Action: update (default), approve, reject, enable, disable.");
         option.setArgName("action");
         options.addOption(option);
@@ -55,6 +57,15 @@ public class AuthenticatorModifyCLI extends CLI {
         option = new Option(null, "input", true, "Input file containing authenticator properties.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -64,20 +75,15 @@ public class AuthenticatorModifyCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Authenticator ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String authenticatorID = cmdArgs[0];
@@ -91,7 +97,7 @@ public class AuthenticatorModifyCLI extends CLI {
             if (input == null) {
                 System.err.println("Error: Missing input file");
                 printHelp();
-                System.exit(1);
+                System.exit(-1);
                 return;
             }
 
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 02bf1b1..f9352c6 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
@@ -20,6 +20,8 @@ package com.netscape.cmstools.tps.authenticator;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -36,21 +38,34 @@ public class AuthenticatorRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Authenticator ID>", options);
+        formatter.printHelp(getFullName() + " <Authenticator ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Authenticator ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String authenticatorID = args[0];
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 65e3d67..65da202 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
@@ -20,6 +20,7 @@ package com.netscape.cmstools.tps.authenticator;
 
 import java.io.FileWriter;
 import java.io.PrintWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -38,17 +39,27 @@ public class AuthenticatorShowCLI extends CLI {
     public AuthenticatorShowCLI(AuthenticatorCLI authenticatorCLI) {
         super("show", "Show authenticator", authenticatorCLI);
         this.authenticatorCLI = authenticatorCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Authenticator ID>", options);
+        formatter.printHelp(getFullName() + " <Authenticator ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "output", true, "Output file to store authenticator properties.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -58,20 +69,15 @@ public class AuthenticatorShowCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Authenticator ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String authenticatorID = args[0];
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 a57ab63..b79c9c8 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
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.tps.cert;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -38,14 +39,15 @@ public class TPSCertFindCLI extends CLI {
     public TPSCertFindCLI(TPSCertCLI certCLI) {
         super("find", "Find certificates", certCLI);
         this.certCLI = certCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [FILTER] [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -53,6 +55,15 @@ public class TPSCertFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -62,13 +73,7 @@ public class TPSCertFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
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 23efd67..24513a6 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
@@ -20,6 +20,8 @@ package com.netscape.cmstools.tps.cert;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.certsrv.tps.cert.TPSCertData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -37,21 +39,34 @@ public class TPSCertShowCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Certificate ID>", options);
+        formatter.printHelp(getFullName() + " <Certificate ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Certificate ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String certID = args[0];
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 0665471..1136b09 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
@@ -42,21 +42,15 @@ public class ConfigModifyCLI extends CLI {
     public ConfigModifyCLI(ConfigCLI configCLI) {
         super("mod", "Modify general properties", configCLI);
         this.configCLI = configCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " --input <file> [OPTIONS...]", options);
     }
 
-    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);
-        }
-
+    public void createOptions() {
         Option option = new Option(null, "input", true, "Input file containing general properties.");
         option.setArgName("file");
         option.setRequired(true);
@@ -65,6 +59,15 @@ public class ConfigModifyCLI extends CLI {
         option = new Option(null, "output", true, "Output file to store general properties.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -74,25 +77,20 @@ public class ConfigModifyCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String input = cmd.getOptionValue("input");
         String output = cmd.getOptionValue("output");
 
-        if (input == null) {
-            System.err.println("Error: Input file is required.");
-            printHelp();
-            System.exit(1);
-        }
-
         ConfigData configData;
 
         try (BufferedReader in = new BufferedReader(new FileReader(input));
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 c04d6f5..90c4c04 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
@@ -20,6 +20,7 @@ package com.netscape.cmstools.tps.config;
 
 import java.io.FileWriter;
 import java.io.PrintWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -38,17 +39,27 @@ public class ConfigShowCLI extends CLI {
     public ConfigShowCLI(ConfigCLI configCLI) {
         super("show", "Show general properties", configCLI);
         this.configCLI = configCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName(), options);
+        formatter.printHelp(getFullName() + "[OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "output", true, "Output file to store general properties.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -58,20 +69,15 @@ public class ConfigShowCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String output = cmd.getOptionValue("output");
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 eb49fcb..06307b9 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
@@ -41,26 +41,29 @@ public class ConnectionAddCLI extends CLI {
     public ConnectionAddCLI(ConnectionCLI connectionCLI) {
         super("add", "Add connection", connectionCLI);
         this.connectionCLI = connectionCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " --input <file> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
+    public void createOptions() {
+        Option option = new Option(null, "input", true, "Input file containing connection properties.");
+        option.setArgName("file");
+        option.setRequired(true);
+        options.addOption(option);
+    }
 
-        // Check for "--help" prior to parsing due to required option
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
         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);
-        options.addOption(option);
-
         CommandLine cmd = null;
 
         try {
@@ -69,14 +72,15 @@ public class ConnectionAddCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String input = cmd.getOptionValue("input");
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 ad4ac00..0685c50 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
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.tps.connection;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -38,14 +39,15 @@ public class ConnectionFindCLI extends CLI {
     public ConnectionFindCLI(ConnectionCLI connectionCLI) {
         super("find", "Find connections", connectionCLI);
         this.connectionCLI = connectionCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [FILTER] [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -53,6 +55,15 @@ public class ConnectionFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -62,13 +73,7 @@ public class ConnectionFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
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 a052618..0d5de70 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
@@ -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;
@@ -40,14 +41,15 @@ public class ConnectionModifyCLI extends CLI {
     public ConnectionModifyCLI(ConnectionCLI connectionCLI) {
         super("mod", "Modify connection", connectionCLI);
         this.connectionCLI = connectionCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <Connection ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "action", true, "Action: update (default), approve, reject, enable, disable.");
         option.setArgName("action");
         options.addOption(option);
@@ -55,6 +57,15 @@ public class ConnectionModifyCLI extends CLI {
         option = new Option(null, "input", true, "Input file containing connection properties.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -64,20 +75,15 @@ public class ConnectionModifyCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Connection ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String connectionID = cmdArgs[0];
@@ -91,7 +97,7 @@ public class ConnectionModifyCLI extends CLI {
             if (input == null) {
                 System.err.println("Error: Missing input file");
                 printHelp();
-                System.exit(1);
+                System.exit(-1);
                 return;
             }
 
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 0080655..6828910 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
@@ -20,6 +20,8 @@ package com.netscape.cmstools.tps.connection;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -36,21 +38,34 @@ public class ConnectionRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Connection ID>", options);
+        formatter.printHelp(getFullName() + " <Connection ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Connection ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String connectionID = args[0];
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 852e330..5a37aaf 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
@@ -20,6 +20,7 @@ package com.netscape.cmstools.tps.connection;
 
 import java.io.FileWriter;
 import java.io.PrintWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -38,17 +39,27 @@ public class ConnectionShowCLI extends CLI {
     public ConnectionShowCLI(ConnectionCLI connectionCLI) {
         super("show", "Show connection", connectionCLI);
         this.connectionCLI = connectionCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Connection ID>", options);
+        formatter.printHelp(getFullName() + " <Connection ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "output", true, "Output file to store connection properties.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -58,20 +69,15 @@ public class ConnectionShowCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Connection ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String connectionID = args[0];
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 70e0e8c..11fbb21 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
@@ -41,26 +41,29 @@ public class ProfileAddCLI extends CLI {
     public ProfileAddCLI(ProfileCLI profileCLI) {
         super("add", "Add profile", profileCLI);
         this.profileCLI = profileCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " --input <file> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
+    public void createOptions() {
+        Option option = new Option(null, "input", true, "Input file containing profile properties.");
+        option.setArgName("file");
+        option.setRequired(true);
+        options.addOption(option);
+    }
 
-        // Check for "--help" prior to parsing due to required option
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
         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);
-        options.addOption(option);
-
         CommandLine cmd = null;
 
         try {
@@ -69,14 +72,15 @@ public class ProfileAddCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String input = cmd.getOptionValue("input");
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 5f6b20c..b918262 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
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.tps.profile;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -38,14 +39,15 @@ public class ProfileFindCLI extends CLI {
     public ProfileFindCLI(ProfileCLI profileCLI) {
         super("find", "Find profiles", profileCLI);
         this.profileCLI = profileCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [FILTER] [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -53,6 +55,15 @@ public class ProfileFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -62,13 +73,7 @@ public class ProfileFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
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 bf9601e..65958cb 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
@@ -41,26 +41,29 @@ public class ProfileMappingAddCLI extends CLI {
     public ProfileMappingAddCLI(ProfileMappingCLI profileMappingCLI) {
         super("add", "Add profile mapping", profileMappingCLI);
         this.profileMappingCLI = profileMappingCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " --input <file> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
+    public void createOptions() {
+        Option option = new Option(null, "input", true, "Input file containing profile mapping properties.");
+        option.setArgName("file");
+        option.setRequired(true);
+        options.addOption(option);
+    }
 
-        // Check for "--help" prior to parsing due to required option
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
         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);
-        options.addOption(option);
-
         CommandLine cmd = null;
 
         try {
@@ -69,14 +72,15 @@ public class ProfileMappingAddCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 0) {
+            System.err.println("Error: Too many arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String input = cmd.getOptionValue("input");
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 1946820..d3a63f5 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
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.tps.profile;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -38,14 +39,15 @@ public class ProfileMappingFindCLI extends CLI {
     public ProfileMappingFindCLI(ProfileMappingCLI profileMappingCLI) {
         super("find", "Find profile mappings", profileMappingCLI);
         this.profileMappingCLI = profileMappingCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [FILTER] [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -53,6 +55,15 @@ public class ProfileMappingFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -62,13 +73,7 @@ public class ProfileMappingFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
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 8a4adc5..22466e8 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
@@ -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;
@@ -40,14 +41,15 @@ public class ProfileMappingModifyCLI extends CLI {
     public ProfileMappingModifyCLI(ProfileMappingCLI profileMappingCLI) {
         super("mod", "Modify profile mapping", profileMappingCLI);
         this.profileMappingCLI = profileMappingCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <Profile Mapping ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "action", true, "Action: update (default), approve, reject, enable, disable.");
         option.setArgName("action");
         options.addOption(option);
@@ -55,6 +57,15 @@ public class ProfileMappingModifyCLI extends CLI {
         option = new Option(null, "input", true, "Input file containing profile mapping properties.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -64,20 +75,15 @@ public class ProfileMappingModifyCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Profile Mapping ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String profileMappingID = cmdArgs[0];
@@ -91,7 +97,7 @@ public class ProfileMappingModifyCLI extends CLI {
             if (input == null) {
                 System.err.println("Error: Missing input file");
                 printHelp();
-                System.exit(1);
+                System.exit(-1);
                 return;
             }
 
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 0fa33b3..484bda2 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
@@ -20,6 +20,8 @@ package com.netscape.cmstools.tps.profile;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -36,21 +38,34 @@ public class ProfileMappingRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Profile Mapping ID>", options);
+        formatter.printHelp(getFullName() + " <Profile Mapping ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Profile Mapping ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String profileMappingID = args[0];
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 b582066..3951522 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
@@ -20,6 +20,7 @@ package com.netscape.cmstools.tps.profile;
 
 import java.io.FileWriter;
 import java.io.PrintWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -38,17 +39,27 @@ public class ProfileMappingShowCLI extends CLI {
     public ProfileMappingShowCLI(ProfileMappingCLI profileMappingCLI) {
         super("show", "Show profileMapping", profileMappingCLI);
         this.profileMappingCLI = profileMappingCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Profile Mapping ID>", options);
+        formatter.printHelp(getFullName() + " <Profile Mapping ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "output", true, "Output file to store profile mapping properties.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -58,20 +69,15 @@ public class ProfileMappingShowCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Profile Mapping ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String profileMappingID = args[0];
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 5231828..87580cd 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
@@ -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;
@@ -40,14 +41,15 @@ public class ProfileModifyCLI extends CLI {
     public ProfileModifyCLI(ProfileCLI profileCLI) {
         super("mod", "Modify profile", profileCLI);
         this.profileCLI = profileCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <Profile ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "action", true, "Action: update (default), approve, reject, enable, disable.");
         option.setArgName("action");
         options.addOption(option);
@@ -55,6 +57,15 @@ public class ProfileModifyCLI extends CLI {
         option = new Option(null, "input", true, "Input file containing profile properties.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -64,20 +75,15 @@ public class ProfileModifyCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Profile ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String profileID = cmdArgs[0];
@@ -91,7 +97,7 @@ public class ProfileModifyCLI extends CLI {
             if (input == null) {
                 System.err.println("Error: Missing input file");
                 printHelp();
-                System.exit(1);
+                System.exit(-1);
                 return;
             }
 
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 23fceb3..4aca086 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
@@ -20,6 +20,8 @@ package com.netscape.cmstools.tps.profile;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -36,21 +38,34 @@ public class ProfileRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Profile ID>", options);
+        formatter.printHelp(getFullName() + " <Profile ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Profile ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String profileID = args[0];
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 37d1ed4..1a4f8a8 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
@@ -20,6 +20,7 @@ package com.netscape.cmstools.tps.profile;
 
 import java.io.FileWriter;
 import java.io.PrintWriter;
+import java.util.Arrays;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
@@ -38,17 +39,27 @@ public class ProfileShowCLI extends CLI {
     public ProfileShowCLI(ProfileCLI profileCLI) {
         super("show", "Show profile", profileCLI);
         this.profileCLI = profileCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Profile ID>", options);
+        formatter.printHelp(getFullName() + " <Profile ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "output", true, "Output file to store profile properties.");
         option.setArgName("file");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -58,20 +69,15 @@ public class ProfileShowCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Profile ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String profileID = args[0];
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 396dbc6..a63df2e 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
@@ -37,26 +37,29 @@ public class TokenAddCLI extends CLI {
     public TokenAddCLI(TokenCLI tokenCLI) {
         super("add", "Add token", tokenCLI);
         this.tokenCLI = tokenCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Token ID> [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " <Token ID> --user <User ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
+    public void createOptions() {
+        Option option = new Option(null, "user", true, "User ID");
+        option.setArgName("User ID");
+        option.setRequired(true);
+        options.addOption(option);
+    }
 
-        // Check for "--help" prior to parsing due to required option
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
         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);
-        options.addOption(option);
-
         CommandLine cmd = null;
 
         try {
@@ -65,14 +68,15 @@ public class TokenAddCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Token ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String tokenID = cmdArgs[0];
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 bb1a166..9afc05e 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
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.tps.token;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -38,14 +39,15 @@ public class TokenFindCLI extends CLI {
     public TokenFindCLI(TokenCLI tokenCLI) {
         super("find", "Find tokens", tokenCLI);
         this.tokenCLI = tokenCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [FILTER] [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -53,6 +55,15 @@ public class TokenFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -62,13 +73,7 @@ public class TokenFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
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 beb2373..1c5602c 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
@@ -37,26 +37,29 @@ public class TokenModifyCLI extends CLI {
     public TokenModifyCLI(TokenCLI tokenCLI) {
         super("mod", "Modify token", tokenCLI);
         this.tokenCLI = tokenCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Token ID> [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " <Token ID> --user <User ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
+    public void createOptions() {
+        Option option = new Option(null, "user", true, "User ID");
+        option.setArgName("User ID");
+        option.setRequired(true);
+        options.addOption(option);
+    }
 
-        // Check for "--help" prior to parsing due to required option
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
         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);
-        options.addOption(option);
-
         CommandLine cmd = null;
 
         try {
@@ -65,14 +68,15 @@ public class TokenModifyCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No Token ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String tokenID = cmdArgs[0];
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 60e5c9a..5dd0689 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
@@ -20,6 +20,8 @@ package com.netscape.cmstools.tps.token;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -36,21 +38,34 @@ public class TokenRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Token ID>", options);
+        formatter.printHelp(getFullName() + " <Token ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Token ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String tokenID = args[0];
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 65ee320..eb243f3 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
@@ -20,6 +20,8 @@ package com.netscape.cmstools.tps.token;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.certsrv.tps.token.TokenData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -37,21 +39,34 @@ public class TokenShowCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Token ID>", options);
+        formatter.printHelp(getFullName() + " <Token ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No Token ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String tokenID = args[0];
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 903b72e..281d2ab 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserAddCLI.java
@@ -37,21 +37,15 @@ public class UserAddCLI extends CLI {
     public UserAddCLI(UserCLI userCLI) {
         super("add", "Add user", userCLI);
         this.userCLI = userCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <User ID> [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " <User ID> --fullName <fullname> [OPTIONS...]", options);
     }
 
-    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);
-        }
-
+    public void createOptions() {
         Option option = new Option(null, "fullName", true, "Full name");
         option.setArgName("fullName");
         option.setRequired(true);
@@ -76,6 +70,15 @@ public class UserAddCLI extends CLI {
         option = new Option(null, "state", true, "State");
         option.setArgName("state");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -85,14 +88,15 @@ public class UserAddCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No User ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String userID = cmdArgs[0];
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 4ee1f0d..4fa6069 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserCertAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserCertAddCLI.java
@@ -39,26 +39,29 @@ public class UserCertAddCLI extends CLI {
     public UserCertAddCLI(UserCertCLI userCertCLI) {
         super("add", "Add user certificate", userCertCLI);
         this.userCertCLI = userCertCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <User ID> [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " <User ID> --input <file> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
+    public void createOptions() {
+        Option option = new Option(null, "input", true, "Input file");
+        option.setArgName("file");
+        option.setRequired(true);
+        options.addOption(option);
+    }
 
-        // Check for "--help" prior to parsing due to required option
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
         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);
-        options.addOption(option);
-
         CommandLine cmd = null;
 
         try {
@@ -67,14 +70,15 @@ public class UserCertAddCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No User ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String userId = cmdArgs[0];
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 e5e921e..9f70e20 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserCertFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserCertFindCLI.java
@@ -39,21 +39,15 @@ public class UserCertFindCLI extends CLI {
     public UserCertFindCLI(UserCertCLI userCertCLI) {
         super("find", "Find user certificates", userCertCLI);
         this.userCertCLI = userCertCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <User ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
-        if (Arrays.asList(args).contains("--help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -61,6 +55,15 @@ public class UserCertFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -70,20 +73,15 @@ public class UserCertFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No User ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String userID = cmdArgs[0];
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 5c01db2..dd841cb 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserCertRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserCertRemoveCLI.java
@@ -21,6 +21,8 @@ package com.netscape.cmstools.user;
 import java.net.URLEncoder;
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -38,21 +40,34 @@ public class UserCertRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <User ID> <Cert ID>", options);
+        formatter.printHelp(getFullName() + " <User ID> <Cert ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 2) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 2) {
+            System.err.println("Error: Insufficient number of arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String userID = args[0];
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 6f75bfa..60a1a83 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserCertShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserCertShowCLI.java
@@ -40,27 +40,30 @@ public class UserCertShowCLI extends CLI {
     public UserCertShowCLI(UserCertCLI userCertCLI) {
         super("show", "Show user certificate", userCertCLI);
         this.userCertCLI = userCertCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <User ID> <Cert ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
-        if (Arrays.asList(args).contains("--help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
-
+    public void createOptions() {
         Option option = new Option(null, "output", true, "Output file");
         option.setArgName("file");
         options.addOption(option);
 
         options.addOption(null, "pretty", false, "Pretty print");
         options.addOption(null, "encoded", false, "Base-64 encoded");
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -70,25 +73,20 @@ public class UserCertShowCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
-        boolean showPrettyPrint = cmd.hasOption("pretty");
-        boolean showEncoded = cmd.hasOption("encoded");
-
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 2) {
+            System.err.println("Error: Insufficient number of arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
+        boolean showPrettyPrint = cmd.hasOption("pretty");
+        boolean showEncoded = cmd.hasOption("encoded");
+
         String userID = cmdArgs[0];
         String certID = cmdArgs[1];
         String file = cmd.getOptionValue("output");
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 2dfa45b..6465310 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserFindCLI.java
@@ -18,6 +18,7 @@
 
 package com.netscape.cmstools.user;
 
+import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.cli.CommandLine;
@@ -38,14 +39,15 @@ public class UserFindCLI extends CLI {
     public UserFindCLI(UserCLI userCLI) {
         super("find", "Find users", userCLI);
         this.userCLI = userCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " [FILTER] [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -53,6 +55,15 @@ public class UserFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -62,13 +73,7 @@ public class UserFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
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 468ed40..c71d498 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserMembershipAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserMembershipAddCLI.java
@@ -20,6 +20,8 @@ package com.netscape.cmstools.user;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.certsrv.user.UserMembershipData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -37,21 +39,34 @@ public class UserMembershipAddCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <User ID> <Group ID>", options);
+        formatter.printHelp(getFullName() + " <User ID> <Group ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 2) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 2) {
+            System.err.println("Error: Insufficient number of arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String userID = args[0];
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 ddcf9f2..011c77f 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserMembershipFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserMembershipFindCLI.java
@@ -39,21 +39,15 @@ public class UserMembershipFindCLI extends CLI {
     public UserMembershipFindCLI(UserMembershipCLI userMembershipCLI) {
         super("find", "Find user memberships", userMembershipCLI);
         this.userMembershipCLI = userMembershipCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <User ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
-        if (Arrays.asList(args).contains("--help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
-        }
-
+    public void createOptions() {
         Option option = new Option(null, "start", true, "Page start");
         option.setArgName("start");
         options.addOption(option);
@@ -61,6 +55,15 @@ public class UserMembershipFindCLI extends CLI {
         option = new Option(null, "size", true, "Page size");
         option.setArgName("size");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -70,20 +73,15 @@ public class UserMembershipFindCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No User ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String userID = cmdArgs[0];
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 493582d..e21b165 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserMembershipRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserMembershipRemoveCLI.java
@@ -20,6 +20,8 @@ package com.netscape.cmstools.user;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -36,21 +38,34 @@ public class UserMembershipRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <User ID> <Group ID>", options);
+        formatter.printHelp(getFullName() + " <User ID> <Group ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 2) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 2) {
+            System.err.println("Error: Insufficient number of arguments specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String userID = args[0];
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 2d685c9..b0e2e8e 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserModifyCLI.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;
 
@@ -35,14 +37,15 @@ public class UserModifyCLI extends CLI {
     public UserModifyCLI(UserCLI userCLI) {
         super("mod", "Modify user", userCLI);
         this.userCLI = userCLI;
+
+        createOptions();
     }
 
     public void printHelp() {
         formatter.printHelp(getFullName() + " <User ID> [OPTIONS...]", options);
     }
 
-    public void execute(String[] args) throws Exception {
-
+    public void createOptions() {
         Option option = new Option(null, "fullName", true, "Full name");
         option.setArgName("fullName");
         options.addOption(option);
@@ -67,6 +70,15 @@ public class UserModifyCLI extends CLI {
         option = new Option(null, "state", true, "State");
         option.setArgName("state");
         options.addOption(option);
+    }
+
+    public void execute(String[] args) throws Exception {
+        // Always check for "--help" prior to parsing
+        if (Arrays.asList(args).contains("--help")) {
+            // Display usage
+            printHelp();
+            System.exit(0);
+        }
 
         CommandLine cmd = null;
 
@@ -76,20 +88,15 @@ public class UserModifyCLI extends CLI {
         } catch (Exception e) {
             System.err.println("Error: " + e.getMessage());
             printHelp();
-            System.exit(1);
-        }
-
-        if (cmd.hasOption("help")) {
-            // Display usage
-            printHelp();
-            System.exit(0);
+            System.exit(-1);
         }
 
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
+            System.err.println("Error: No User ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String userId = cmdArgs[0];
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 ffc6c1e..83db50f 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserRemoveCLI.java
@@ -20,6 +20,8 @@ package com.netscape.cmstools.user;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -36,21 +38,34 @@ public class UserRemoveCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <User ID>", options);
+        formatter.printHelp(getFullName() + " <User ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No User ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String userID = args[0];
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 95f4d31..dafebff 100644
--- a/base/java-tools/src/com/netscape/cmstools/user/UserShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserShowCLI.java
@@ -20,6 +20,8 @@ package com.netscape.cmstools.user;
 
 import java.util.Arrays;
 
+import org.apache.commons.cli.CommandLine;
+
 import com.netscape.certsrv.user.UserData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -37,21 +39,34 @@ public class UserShowCLI extends CLI {
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <User ID>", options);
+        formatter.printHelp(getFullName() + " <User ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
-
-        // Check for "--help"
+        // Always check for "--help" prior to parsing
         if (Arrays.asList(args).contains("--help")) {
             // Display usage
             printHelp();
             System.exit(0);
         }
 
-        if (args.length != 1) {
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(-1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            System.err.println("Error: No User ID specified.");
             printHelp();
-            System.exit(1);
+            System.exit(-1);
         }
 
         String userId = args[0];
-- 
1.9.0

