Added comments and help commands to user apps
This commit is contained in:
11
count.c
11
count.c
@ -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();
|
||||
|
Reference in New Issue
Block a user