diff options
Diffstat (limited to 'main/src/main/java/org/onap/cli/main/OnapCli.java')
-rw-r--r-- | main/src/main/java/org/onap/cli/main/OnapCli.java | 22 |
1 files changed, 9 insertions, 13 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 1c27205f..eb75836c 100644 --- a/main/src/main/java/org/onap/cli/main/OnapCli.java +++ b/main/src/main/java/org/onap/cli/main/OnapCli.java @@ -238,7 +238,7 @@ public class OnapCli { * Handles batch command. --param-file */ public void handleBatchCommand() { - try { + try { //NOSONAR if (this.paramFile != null) { //Read YAML and loop thru it // one @@ -382,22 +382,18 @@ public class OnapCli { this.args = new ArrayList<>(); this.args.addAll(Arrays.asList(line.split(OnapCliConstants.PARAM_INTERACTIVE_ARG_SPLIT_PATTERN))); - if (!args.isEmpty() && this.args.get(0).equals(OnapCliConstants.PARAM_INTERACTIVE_USE)) { - if (args.size() == 1) { - this.print("Please use it in the form of use <product-version>.\nSupported versions: " + - OnapCommandRegistrar.getRegistrar().getAvailableProductVersions()); - } else { - try { + if (!args.isEmpty() && this.args.get(0).equals(OnapCliConstants.PARAM_INTERACTIVE_USE)) { + if (args.size() == 1) { + this.print("Please use it in the form of use <product-version>.\nSupported versions: " + + OnapCommandRegistrar.getRegistrar().getAvailableProductVersions()); + } else { OnapCommandRegistrar.getRegistrar().setEnabledProductVersion(args.get(1)); console = createConsoleReader(); - } catch (OnapCommandException e) { - this.print(e); } - } - } else if (!args.isEmpty() && this.args.get(0).equals(OnapCliConstants.PARAM_INTERACTIVE_HELP)) { - this.print(OnapCommandRegistrar.getRegistrar().getHelpForEnabledProductVersion()); - this.print(OnapCli.getDirectiveHelp()); + } else if (!args.isEmpty() && this.args.get(0).equals(OnapCliConstants.PARAM_INTERACTIVE_HELP)) { + this.print(OnapCommandRegistrar.getRegistrar().getHelpForEnabledProductVersion()); + this.print(OnapCli.getDirectiveHelp()); } else if (!args.isEmpty() && this.args.get(0).equals(OnapCliConstants.PARAM_INTERACTIVE_VERSION)) { this.printVersion = true; handleVersion(); |