Added comments and help commands to user apps

This commit is contained in:
iDunnoDev
2023-01-13 17:37:43 +00:00
committed by iDunnoDev
parent c23d669858
commit f74cebc12d
11 changed files with 197 additions and 55 deletions

11
count.c
View File

@ -1,6 +1,8 @@
#include "types.h"
#include "user.h"
// Simple user app to do a count from 0 to the given number (1000 by defaulf)
// for testing concurrency
int main(int argc, char *argv[]) {
int countto = 1000;
@ -8,6 +10,15 @@ int main(int argc, char *argv[]) {
if (strcmp(argv[i], "-c") == 0) {
countto = atoi(argv[i + 1]);
}
else if (strcmp(argv[i], "-help") == 0)
{
printf(1, "Counts from 0 to the given number.\n");
printf(1, "Default: 1000\n");
printf(1, "Options:\n");
printf(1, "-c [Number] : Sets the value to count upto.\n");
exit();
return 0;
}
}
cls();