aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-07 14:23:14 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-07 16:48:07 +0530
commitf24521907506d3c7b77375d76661458bc3ad9f33 (patch)
treedb946322c605a6f3e922a53fd793d5b57ea62fbe /main
parent1b45d1a610274ebd99b3bf361f5ec41aff338da9 (diff)
Make set specific to product version
CLI-2 Change-Id: If6c72255c4c84615dafe5f0074eb5532bc90bf5e 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.java13
1 files changed, 5 insertions, 8 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 52922277..c175f67b 100644
--- a/main/src/main/java/org/onap/cli/main/OnapCli.java
+++ b/main/src/main/java/org/onap/cli/main/OnapCli.java
@@ -50,7 +50,6 @@ import jline.console.ConsoleReader;
public class OnapCli {
private List<String> args = new ArrayList<>();
- Map<String, String> paramCache = new HashMap<>();
private int exitCode = -1;
@@ -212,19 +211,17 @@ public class OnapCli {
if (args.size() > 1) {
String [] paramEntry = args.get(1).trim().split("=");
if (paramEntry.length >= 2) {
- this.paramCache.put(paramEntry[0].trim(), paramEntry[1].trim());
+ OnapCommandRegistrar.getRegistrar().addParamCache(paramEntry[0].trim(), paramEntry[1].trim());
} else {
this.print("Please use it in the form of 'set param-name=param-value'");
}
} else {
- this.print(this.paramCache.toString());
+ this.print(OnapCommandRegistrar.getRegistrar().getParamCache().toString());
}
} else if (!args.isEmpty() && this.args.get(0).equals(OnapCliConstants.PARAM_INTERACTIVE_UNSET)) {
if (args.size() > 1) {
for (int i = 1; i <args.size(); i++) {
- if (this.paramCache.containsKey(args.get(i))) {
- this.paramCache.remove(args.get(i));
- }
+ OnapCommandRegistrar.getRegistrar().removeParamCache(args.get(i));
}
}
} else {
@@ -313,8 +310,8 @@ public class OnapCli {
}
for (OnapCommandParameter param: cmd.getParameters()) {
- if (this.paramCache.containsKey(param.getLongOption())) {
- param.setValue(this.paramCache.get(param.getLongOption()));
+ if (OnapCommandRegistrar.getRegistrar().getParamCache().containsKey(param.getLongOption())) {
+ param.setValue(OnapCommandRegistrar.getRegistrar().getParamCache().get(param.getLongOption()));
}
}