add cli ref to command function
This commit is contained in:
parent
f08c8e5788
commit
8261e605bc
@ -173,7 +173,7 @@ int tryExecute(CLI_t* cli, FIFOBuffChar_t* fifo)
|
|||||||
#ifdef HISTORY
|
#ifdef HISTORY
|
||||||
History_put(cli->History, line);
|
History_put(cli->History, line);
|
||||||
#endif
|
#endif
|
||||||
int ret = (*(cmd->fn))(line);
|
int ret = (*(cmd->fn))(line, cli);
|
||||||
|
|
||||||
if (ret != INT_MIN)
|
if (ret != INT_MIN)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -39,6 +39,8 @@ extern void CLI_PrintHistory(CLI_t* cli);
|
|||||||
|
|
||||||
// to recive a single caracter
|
// to recive a single caracter
|
||||||
bool CLI_charIn(CLI_t* cli, char c);
|
bool CLI_charIn(CLI_t* cli, char c);
|
||||||
|
void CLI_charOut_save(CLI_t* cli, char ch);
|
||||||
|
void CLI_stringOut(CLI_t* cli, char* str);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
typedef struct CMD_t {
|
typedef struct CMD_t {
|
||||||
char* cmd;
|
char* cmd;
|
||||||
int (*fn)(char* line);
|
int (*fn)(char* line, void* cli);
|
||||||
} CMD_t;
|
} CMD_t;
|
||||||
|
|
||||||
typedef struct CMDList_s {
|
typedef struct CMDList_s {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user