aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-12-16 01:07:35 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-12-16 01:07:35 +0530
commit954d09160c9e6833ad16743165ee7c3e4940a7ac (patch)
treef29f4df32c428b9163d7c0e5cd863569d836cecf /main
parentad64951c1df7518bd6e8d6969f551db5014bf0db (diff)
Add getNoOfRows in Results object
Issue-ID: CLI-66 Change-Id: I89fa87019c63504e8f8ceb4f052f12e62941bc3a 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, 12 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 149fd955..65edfc13 100644
--- a/main/src/main/java/org/onap/cli/main/OnapCli.java
+++ b/main/src/main/java/org/onap/cli/main/OnapCli.java
@@ -56,12 +56,19 @@ public class OnapCli {
private List<String> args = new ArrayList<>();
+ private String product = null;
+
private int exitCode = -1;
public OnapCli(String[] args) {
this.args = Arrays.asList(args);
}
+ public OnapCli(String product, String[] args) {
+ this(args);
+ this.product = product;
+ }
+
private void exitSuccessfully() {
this.exitCode = OnapCliConstants.EXIT_SUCCESS;
}
@@ -323,7 +330,11 @@ public class OnapCli {
OnapCommand cmd;
if (!args.isEmpty()) {
try {
- cmd = OnapCommandRegistrar.getRegistrar().get(args.get(0));
+ if (this.product != null) {
+ cmd = OnapCommandRegistrar.getRegistrar().get(args.get(0), this.product);
+ } else {
+ cmd = OnapCommandRegistrar.getRegistrar().get(args.get(0));
+ }
} catch (Exception e) {
this.print(e);
this.exitFailure();