aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2020-06-15 10:02:57 +0000
committerGerrit Code Review <gerrit@fd.io>2020-06-15 10:02:57 +0000
commit961352d7801c4f4bbee2990690b7d5ac5e3c88d6 (patch)
tree20f3915fa8220caec629cfbc1dd918acc359e0e4 /hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
parent0f3841ea94ed9019a538516d774f5936b301e9a0 (diff)
parent9e2c045d6118ef264d6cf8fc655b72d7c4c403dc (diff)
Merge "[HICN-626] Return output from libhicnlight"
Diffstat (limited to 'hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c')
-rw-r--r--hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c b/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
index 8f56dc60a..31b9674ca 100644
--- a/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
+++ b/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
@@ -340,6 +340,9 @@ int main(int argc, char *argv[]) {
mainState.controlState =
controlState_Create(&mainState, _writeAndReadMessage, true,
server_ip, server_port);
+ if (mainState.controlState == NULL) {
+ exit(EXIT_FAILURE);
+ }
controlState_RegisterCommand(mainState.controlState,
controlRoot_HelpCreate(mainState.controlState));
@@ -348,7 +351,9 @@ int main(int argc, char *argv[]) {
if (parcList_Size(commands) > 0) {
controlState_SetInteractiveFlag(mainState.controlState, false);
- controlState_DispatchCommand(mainState.controlState, commands);
+ char output[8192];
+ controlState_DispatchCommand(mainState.controlState, commands, output, sizeof(output));
+ printf("%s", output);
char **commandOutputMain =
controlState_GetCommandOutput(mainState.controlState);
if (commandOutputMain != NULL && commandOutputLen > 0) {