From ccb8d7148fc4f50fa9d949edb4f47ad6742af2bc Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Tue, 6 Aug 2013 02:29:50 -0400 Subject: Refactored CLI framework. Some common CLI methods and attributes have been refactored into the CLI base class. A new SubsystemCLI class was added as the base for subsystem CLI modules. The MainCLI was modified such that it will only perform authentication if the subsystem is specified in the server URI. If no subsystem is specified in the URI, the authentication will be done by the subsystem CLI module. Ticket #701 --- .../src/com/netscape/cmstools/user/UserShowCertCLI.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'base/java-tools/src/com/netscape/cmstools/user/UserShowCertCLI.java') diff --git a/base/java-tools/src/com/netscape/cmstools/user/UserShowCertCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserShowCertCLI.java index f30c72327..87e535f6a 100644 --- a/base/java-tools/src/com/netscape/cmstools/user/UserShowCertCLI.java +++ b/base/java-tools/src/com/netscape/cmstools/user/UserShowCertCLI.java @@ -34,15 +34,15 @@ import com.netscape.cmstools.cli.MainCLI; */ public class UserShowCertCLI extends CLI { - public UserCLI parent; + public UserCLI userCLI; - public UserShowCertCLI(UserCLI parent) { - super("show-cert", "Show user cert"); - this.parent = parent; + public UserShowCertCLI(UserCLI userCLI) { + super("show-cert", "Show user cert", userCLI); + this.userCLI = userCLI; } public void printHelp() { - formatter.printHelp(parent.name + "-" + name + " [OPTIONS...]", options); + formatter.printHelp(getFullName() + " [OPTIONS...]", options); } public void execute(String[] args) throws Exception { @@ -79,7 +79,7 @@ public class UserShowCertCLI extends CLI { String certID = cmdArgs[1]; String file = cmd.getOptionValue("output"); - UserCertData userCertData = parent.client.getUserCert(userID, URLEncoder.encode(certID, "UTF-8")); + UserCertData userCertData = userCLI.userClient.getUserCert(userID, URLEncoder.encode(certID, "UTF-8")); String encoded = userCertData.getEncoded(); if (encoded != null && file != null) { -- cgit