version 1.3, 2011/03/16 17:24:03
|
version 1.4.2.1, 2013/11/20 16:21:55
|
Line 53 cliCommands_t commands[] = {
|
Line 53 cliCommands_t commands[] = {
|
}; |
}; |
*/ |
*/ |
|
|
|
static int |
|
oho(void *buf, int idx, char **argv) |
|
{ |
|
printf("Oho!!!! level 0\n"); |
|
return 0; |
|
} |
|
|
|
static int |
|
boho(void *buf, int idx, char **argv) |
|
{ |
|
printf("Boho !!!! level 1\n"); |
|
return 0; |
|
} |
|
|
// --------------------------------------- |
// --------------------------------------- |
|
|
int main() | int |
| main(int argc, char **argv) |
{ |
{ |
int ret; |
int ret; |
linebuffer_t *t; |
linebuffer_t *t; |
|
|
// ret = cliExec(commands, "test>"); |
// ret = cliExec(commands, "test>"); |
t = cliInit(0, 1, "test>"); | t = cliInit(0, 1, argv[1]); |
ret = cliLoop(t, NULL); | cli_addCommand(t, "oho", 1, oho, "oho [args]", "oho - is test level 0"); |
| cli_addCommand(t, "boho", 2, boho, "boho [args]", "boho - is test level 1"); |
| ret = cliLoop(t, NULL, 30, NULL); |
cliEnd(t); |
cliEnd(t); |
|
|
return 0; |
return 0; |