version 1.2, 2010/06/04 11:32:47
|
version 1.3, 2011/03/16 17:24:03
|
Line 4
|
Line 4
|
|
|
|
|
// This export commands, good place for write is global header file |
// This export commands, good place for write is global header file |
CLI_REGISTER_COMMANDS(commands) | //CLI_REGISTER_COMMANDS(commands) |
// |
// |
|
|
// --------------------------------------------------------------- |
// --------------------------------------------------------------- |
| /* |
int cmd_test1(void *cmds, int idx, FILE *out, char ** __restrict args) |
int cmd_test1(void *cmds, int idx, FILE *out, char ** __restrict args) |
{ |
{ |
cliCommands_t *c = cmds; |
cliCommands_t *c = cmds; |
Line 51 cliCommands_t commands[] = {
|
Line 51 cliCommands_t commands[] = {
|
{ "exit", cli_Cmd_Exit, "Exit from console", "exit <cr>", NULL }, |
{ "exit", cli_Cmd_Exit, "Exit from console", "exit <cr>", NULL }, |
{ NULL, NULL, NULL, NULL, NULL } |
{ NULL, NULL, NULL, NULL, NULL } |
}; |
}; |
|
*/ |
|
|
|
|
// --------------------------------------- |
// --------------------------------------- |
|
|
int main() |
int main() |
{ |
{ |
int ret; |
int ret; |
|
linebuffer_t *t; |
|
|
ret = cliExec(commands, "test>"); | // ret = cliExec(commands, "test>"); |
| t = cliInit(0, 1, "test>"); |
| ret = cliLoop(t, NULL); |
| cliEnd(t); |
|
|
return 0; |
return 0; |
} |
} |