aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--deployment/docker/src/main/docker/docker-compose.yaml5
-rw-r--r--framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java2
-rw-r--r--main/src/main/java/org/onap/cli/main/OnapCli.java7
3 files changed, 12 insertions, 2 deletions
diff --git a/deployment/docker/src/main/docker/docker-compose.yaml b/deployment/docker/src/main/docker/docker-compose.yaml
index c2c32cb9..aff1f859 100644
--- a/deployment/docker/src/main/docker/docker-compose.yaml
+++ b/deployment/docker/src/main/docker/docker-compose.yaml
@@ -19,12 +19,15 @@ services:
environment:
CLI_MODE: 'console'
- dev:
+ debug:
stdin_open: true
tty: true
image: onap/cli
environment:
CLI_DEV: "true"
CLI_MODE: 'console'
+ ONAP_CLI_DEBUG: "true"
+ expose:
+ - 5005
ports:
- 5005:5005
diff --git a/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java b/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java
index 4e892153..53c2b879 100644
--- a/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java
+++ b/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java
@@ -58,7 +58,7 @@ public class OnapCommandRegistrar {
private boolean isInteractiveMode = false;
- private boolean isDevMode = Boolean.getBoolean(System.getenv(Constants.CLI_DEV_MODE));
+ private boolean isDevMode = Boolean.parseBoolean(System.getenv(Constants.CLI_DEV_MODE));
private OnapCommandParameterCache paramCache = OnapCommandParameterCache.getInstance();
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 8a4ebeb1..36db86c3 100644
--- a/main/src/main/java/org/onap/cli/main/OnapCli.java
+++ b/main/src/main/java/org/onap/cli/main/OnapCli.java
@@ -69,6 +69,13 @@ public class OnapCli {
private void print(Throwable throwable) {
System.out.println(throwable.getMessage());
+ try {
+ if (OnapCommandRegistrar.getRegistrar().isDevMode()) {
+ throwable.printStackTrace();
+ }
+ } catch (OnapCommandException e) {
+ // NOSONAR
+ }
}
private String getShortOption(String opt) {