diff options
Diffstat (limited to 'base/java-tools/src/com/netscape/cmstools/key/KeyTemplateShowCLI.java')
-rw-r--r-- | base/java-tools/src/com/netscape/cmstools/key/KeyTemplateShowCLI.java | 13 |
1 files changed, 8 insertions, 5 deletions
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 2ce8afe83..6e7365256 100644 --- a/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateShowCLI.java +++ b/base/java-tools/src/com/netscape/cmstools/key/KeyTemplateShowCLI.java @@ -3,6 +3,7 @@ package com.netscape.cmstools.key; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; +import java.util.Arrays; import javax.xml.bind.JAXBException; @@ -30,6 +31,13 @@ public class KeyTemplateShowCLI extends CLI { public void execute(String[] args) { + // Check for "--help" + if (Arrays.asList(args).contains("--help")) { + // Display usage + printHelp(); + System.exit(0); + } + Option option = new Option(null, "output-file", true, "Location where the template has to be stored."); option.setArgName("File to write the template to."); options.addOption(option); @@ -49,11 +57,6 @@ public class KeyTemplateShowCLI extends CLI { System.exit(-1); } - if (cmd.hasOption("help")) { - printHelp(); - System.exit(1); - } - String templateId = cmdArgs[0]; String writeToFile = cmd.getOptionValue("output-file"); String templateDir = "/usr/share/pki/key/templates/"; |