aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-01 11:12:40 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-01 11:13:18 +0530
commit9618946f4a8a3a71703669db772356b301317d10 (patch)
tree705c82fba8b2171f49d6d5d99416206a7c6271f0 /main
parente35db04d37e98688c20c6f42fff0c5ce892aa728 (diff)
Add occ
Enables ONAP command console at port 9090 CLI-13 Change-Id: If9f3a41853be200cc9e8e2b6d5c3470e6f013c53 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.java10
-rw-r--r--main/src/main/java/org/onap/cli/main/conf/OnapCliConstants.java1
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 ac63fdfa..b52d89d7 100644
--- a/main/src/main/java/org/onap/cli/main/OnapCli.java
+++ b/main/src/main/java/org/onap/cli/main/OnapCli.java
@@ -151,7 +151,14 @@ public class OnapCli {
} catch (OnapCommandException e) {
this.print(e);
}
+ } else if (!args.isEmpty() && this.args.get(0).equals(OnapCliConstants.PARAM_INTERACTIVE_VERSION)) {
+ this.args = Arrays.asList(new String [] {this.getLongOption(OnapCliConstants.PARAM_VERSION_LONG)});
+ handleVersion();
} else {
+ if (args.size() == 1 && args.get(0).trim().isEmpty()) {
+ //Ignore blanks // NOSONAR
+ continue;
+ }
handleCommand();
}
}
@@ -187,7 +194,8 @@ public class OnapCli {
strCompleter.add(OnapCliConstants.PARAM_INTERACTIVE_EXIT,
OnapCliConstants.PARAM_INTERACTIVE_CLEAR,
OnapCliConstants.PARAM_INTERACTIVE_USE,
- OnapCliConstants.PARAM_INTERACTIVE_HELP);
+ OnapCliConstants.PARAM_INTERACTIVE_HELP,
+ OnapCliConstants.PARAM_INTERACTIVE_VERSION);
console.addCompleter(strCompleter);
console.setPrompt(OnapCliConstants.PARAM_INTERACTIVE_PROMPT);
} catch (OnapCommandException e) { // NOSONAR
diff --git a/main/src/main/java/org/onap/cli/main/conf/OnapCliConstants.java b/main/src/main/java/org/onap/cli/main/conf/OnapCliConstants.java
index d01aa1e5..dfb20c96 100644
--- a/main/src/main/java/org/onap/cli/main/conf/OnapCliConstants.java
+++ b/main/src/main/java/org/onap/cli/main/conf/OnapCliConstants.java
@@ -33,6 +33,7 @@ public final class OnapCliConstants {
public static final String PARAM_INTERACTIVE_CLEAR = "clear";
public static final String PARAM_INTERACTIVE_USE = "use";
public static final String PARAM_INTERACTIVE_HELP = "help";
+ public static final String PARAM_INTERACTIVE_VERSION = "version";
public static final String PARAM_INTERACTIVE_ARG_SPLIT_PATTERN = "\\s+";
private OnapCliConstants(){}