Compare commits

..

2 Commits

Author SHA1 Message Date
0358eefcae add: msg when cmd not found 2023-07-26 14:44:30 +02:00
3e23f44fc3 add: delete 2023-07-26 14:44:04 +02:00
2 changed files with 20 additions and 0 deletions

13
src/commands/delete.🗿 Normal file
View File

@ -0,0 +1,13 @@
cmd_delete(text, args)
{
local i;
i = [text + LOCATION_CURRENT_LINE];
[text + LOCATION_LENGTH] = [text + LOCATION_LENGTH] - 1;
loop
{
if (i == [text + LOCATION_LENGTH])
return 0;
[[text + LOCATION_ARRAY] + i] = [[text + LOCATION_ARRAY] + i + 1];
}
}

View File

@ -73,6 +73,13 @@ main()
cmd_print(text, NULL); cmd_print(text, NULL);
else if (strcmp(cmd, "n") == 0) else if (strcmp(cmd, "n") == 0)
cmd_numbered(text, NULL); cmd_numbered(text, NULL);
else if (strcmp(cmd, "d") == 0)
cmd_delete(text, NULL);
else
{
putstr("cmd not foud");
putchar('\n');
}
free(cmd); free(cmd);
} }
} }