From 954d09160c9e6833ad16743165ee7c3e4940a7ac Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Sat, 16 Dec 2017 01:07:35 +0530 Subject: Add getNoOfRows in Results object Issue-ID: CLI-66 Change-Id: I89fa87019c63504e8f8ceb4f052f12e62941bc3a Signed-off-by: Kanagaraj Manickam k00365106 --- main/src/main/java/org/onap/cli/main/OnapCli.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'main/src') 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 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(); -- cgit 1.2.3-korg