From 337692832a2d969b79992e63d46d70beca3e7acb Mon Sep 17 00:00:00 2001 From: Hernan Ochoa Date: Sat, 29 Jan 2000 19:20:26 +0000 Subject: [PATCH] Added parameters checking, help, and some information about when the program was compiled. svn path=/trunk/; revision=968 --- reactos/apps/tests/thread/thread.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/reactos/apps/tests/thread/thread.c b/reactos/apps/tests/thread/thread.c index e9aa2c6a768..2c107507315 100644 --- a/reactos/apps/tests/thread/thread.c +++ b/reactos/apps/tests/thread/thread.c @@ -18,6 +18,18 @@ DWORD WINAPI thread_main1(LPVOID param) return 0; } +// Shows the help on how to use these program to the user +void showHelp() +{ + +printf("\nReactOS threads test program (built on %s).\n\n", __DATE__); +printf("syntax:\tthread.exe \n"); +printf("\twhere is an integer number\n"); +printf("\texample: thread.exe 100\n"); + + +} + int main (int argc, char* argv[]) { HANDLE hThread; @@ -25,6 +37,14 @@ int main (int argc, char* argv[]) DWORD id; ULONG nr; + + // The user must supply one argument (the seed). if he/she doesn't + // then we show the help. + if(argc < 2) { + showHelp(); + return 1; + } + nr = atoi(argv[1]); printf("Seed %d\n", nr);