close #31 - made all command parameter except the command name optional + added and fixed tests

This commit is contained in:
prozessorkern
2020-03-01 18:45:30 +01:00
parent c807372bce
commit d2617a4f86
8 changed files with 149 additions and 47 deletions

View File

@@ -85,6 +85,17 @@ static shellmatta_retCode_t quit(shellmatta_handle_t handle, const char *argumen
}
shellmatta_cmd_t quitCommand = {"quit", "q", "Function quits the shell", "", quit, NULL};
static shellmatta_retCode_t empty(shellmatta_handle_t handle, const char *arguments, uint32_t length)
{
(void)arguments;
(void)length;
shellmatta_printf(handle, "empty function called\r\n");
return SHELLMATTA_OK;
}
shellmatta_cmd_t emptyCommand = {"empty", NULL, NULL, NULL, empty, NULL};
shellmatta_retCode_t writeFct(const char* data, uint32_t length)
{
@@ -128,6 +139,7 @@ int main(int argc, char **argv)
shellmatta_addCmd(handle, &doSomeCmd);
shellmatta_addCmd(handle, &quitCommand);
shellmatta_addCmd(handle, &removeCommand);
shellmatta_addCmd(handle, &emptyCommand);
while(exitRequest == false)
{