aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-03-06 14:44:24 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-03-08 11:17:58 +0530
commita74a9b50f244f49a38ba36b2b59b3c8e23649949 (patch)
tree6a8027a230d618c66cb9ce5fb5d48bfd0124e132 /main
parent253e9d49e5ceec6d14c833a3ecc40cbff877d5de (diff)
Add profile list support
Issue-ID: CLI-95 Change-Id: Ic50132693fcd8a49c7e0b1bfb38e02f0948f764d Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'main')
-rw-r--r--main/src/main/java/org/onap/cli/main/OnapCli.java4
-rw-r--r--main/src/test/java/org/onap/cli/main/OnapCliMainTest.java7
2 files changed, 10 insertions, 1 deletions
diff --git a/main/src/main/java/org/onap/cli/main/OnapCli.java b/main/src/main/java/org/onap/cli/main/OnapCli.java
index 3f37faba..ca3c365f 100644
--- a/main/src/main/java/org/onap/cli/main/OnapCli.java
+++ b/main/src/main/java/org/onap/cli/main/OnapCli.java
@@ -243,7 +243,9 @@ public class OnapCli {
handleVersion();
} else if (!args.isEmpty() && this.args.get(0).equals(OnapCliConstants.PARAM_INTERACTIVE_PROFILE)) {
if (args.size() == 1) {
- this.print("Please use it in the form of 'profile <profile-name>'");
+ this.print("Please use it in the form of 'profile <profile-name>'\n");
+ this.print("Profiles:");
+ this.print(OnapCommandRegistrar.getRegistrar().getUserProfiles().toString());
} else {
this.args = Arrays.asList(new String [] {
this.getLongOption(OnapCliConstants.PARAM_PROFILE_LONG),
diff --git a/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java b/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java
index f7401904..8fd34413 100644
--- a/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java
+++ b/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java
@@ -152,6 +152,13 @@ public class OnapCliMainTest {
}
cli = new OnapCli(new String[] {});
+ mockConsole("profile");
+ try {
+ cli.handleInteractive();
+ } catch (Exception e) {
+ }
+
+ cli = new OnapCli(new String[] {});
mockConsole("version");
try {
cli.handleInteractive();