close #14 - added a resetShell api function + fixed some problems
This commit is contained in:
@@ -96,6 +96,24 @@ static shellmatta_retCode_t empty(shellmatta_handle_t handle, const char *argume
|
||||
}
|
||||
shellmatta_cmd_t emptyCommand = {"empty", NULL, NULL, NULL, empty, NULL};
|
||||
|
||||
static shellmatta_retCode_t reset(shellmatta_handle_t handle, const char *arguments, uint32_t length)
|
||||
{
|
||||
(void)arguments;
|
||||
(void)length;
|
||||
|
||||
if(0 == strncmp(arguments, "prompt", length))
|
||||
{
|
||||
shellmatta_resetShell(handle, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
shellmatta_resetShell(handle, false);
|
||||
}
|
||||
|
||||
return SHELLMATTA_OK;
|
||||
}
|
||||
shellmatta_cmd_t resetCommand = {"reset", NULL, "resets the shellmatta instance", "reset [prompt]", reset, NULL};
|
||||
|
||||
|
||||
shellmatta_retCode_t writeFct(const char* data, uint32_t length)
|
||||
{
|
||||
@@ -140,6 +158,7 @@ int main(int argc, char **argv)
|
||||
shellmatta_addCmd(handle, &quitCommand);
|
||||
shellmatta_addCmd(handle, &removeCommand);
|
||||
shellmatta_addCmd(handle, &emptyCommand);
|
||||
shellmatta_addCmd(handle, &resetCommand);
|
||||
|
||||
while(exitRequest == false)
|
||||
{
|
||||
|
Reference in New Issue
Block a user