diff --git a/cmdtypist.c b/cmdtypist.c index 7cafeb2..045e9a2 100755 --- a/cmdtypist.c +++ b/cmdtypist.c @@ -21,5 +21,23 @@ void select_lesson(int argc_cmd) while(ch=getchar()!='\n');//disposing off wrong input string. } } - + else + { + fprintf(stderr, "%s\n", "Invalid number of arguments, consult \"cmdtypist --help\" for more"); + exit(EXIT_FAILURE); + } + /* + if(argc_cmd==3) + if(strncmp(argv[2],"select",6)!=0||lesson_choice<1||lesson_choice>20) + { + fprintf(stderr, "%s\n", "Command not found\n"); + if(strncmp(argv[2],"se",2)) + fprintf(stderr, "%s\n", "Did you mean \"select\""); + else if(lesson_choice<1||lesson_choice>20) + fprintf(stderr, "%s %d\n", "No lesson entry for ",lesson_choice); + //else if(ch!=1) + printf("%s", "Lesson number cannot contain symbols or alpha letters.\n"); + exit(EXIT_FAILURE); + }*/ + printf("\n"); } \ No newline at end of file