--- libaitcli/example/test.c 2013/10/08 08:30:33 1.3.14.1 +++ libaitcli/example/test.c 2024/03/19 10:06:37 1.7 @@ -53,6 +53,20 @@ 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 @@ -63,7 +77,9 @@ main(int argc, char **argv) // ret = cliExec(commands, "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, -1); cliEnd(t); return 0;