diff --git a/CLI/CLI.c b/CLI/CLI.c index 20dd15a..9803120 100644 --- a/CLI/CLI.c +++ b/CLI/CLI.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "../FIFOBuff/FIFOBuffChar.h" @@ -76,9 +77,12 @@ int tryExecute(FIFOBuffChar_t* fifo) if (cmd != NULL) { - (*(cmd->fn))(line); + int ret = (*(cmd->fn))(line); - CLI_stringOut((char*)"> "); + if (ret != INT_MIN) + { + CLI_stringOut((char*)"> "); + } return true; } else diff --git a/CMDList/CMDList.h b/CMDList/CMDList.h index e6d3bff..215ae41 100644 --- a/CMDList/CMDList.h +++ b/CMDList/CMDList.h @@ -3,7 +3,7 @@ typedef struct CMD_t { char* cmd; - void (*fn)(char* line); + int (*fn)(char* line); } CMD_t; typedef struct CMDList_s {