diff options
author | Ade Lee <alee@redhat.com> | 2013-07-29 12:23:03 -0400 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2013-07-31 16:57:35 -0400 |
commit | ea1d7a70d9fad28a1729d1de4968edafdaeb0889 (patch) | |
tree | fc7a0fcaae390c9d3963c08386af50234be65ffa /base/java-tools/src/com/netscape/cmstools/profile/ProfileShowCLI.java | |
parent | a5326958593a84236879c1bf9cc8b54e86ce089f (diff) | |
download | pki-ea1d7a70d9fad28a1729d1de4968edafdaeb0889.tar.gz pki-ea1d7a70d9fad28a1729d1de4968edafdaeb0889.tar.xz pki-ea1d7a70d9fad28a1729d1de4968edafdaeb0889.zip |
Fix various issues with Profile Interface
1. Fixed REST API as per review.
2. Add output for profile-show and profile-find
Diffstat (limited to 'base/java-tools/src/com/netscape/cmstools/profile/ProfileShowCLI.java')
-rw-r--r-- | base/java-tools/src/com/netscape/cmstools/profile/ProfileShowCLI.java | 21 |
1 files changed, 10 insertions, 11 deletions
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 de83c1eb9..c3f8675f2 100644 --- a/base/java-tools/src/com/netscape/cmstools/profile/ProfileShowCLI.java +++ b/base/java-tools/src/com/netscape/cmstools/profile/ProfileShowCLI.java @@ -48,24 +48,23 @@ public class ProfileShowCLI extends CLI { String filename = null; if (cmd.hasOption("output")) { filename = cmd.getOptionValue("output"); - } else { - System.err.println("Error: Missing output file name."); - printHelp(); - System.exit(-1); - } - if (filename == null || filename.trim().length() == 0) { - System.err.println("Error: Missing output file name."); - printHelp(); - System.exit(-1); + if (filename == null || filename.trim().length() == 0) { + System.err.println("Error: Missing output file name."); + printHelp(); + System.exit(-1); + } } ProfileData profileData = parent.client.retrieveProfile(profileId); MainCLI.printMessage("Profile \"" + profileId + "\""); - ProfileCLI.printProfile(profileData); - ProfileCLI.saveProfileToFile(filename, profileData); + if (filename != null) { + ProfileCLI.saveProfileToFile(filename, profileData); + } else { + ProfileCLI.printProfile(profileData, parent.parent.config.getServerURI()); + } } } |