dodanie help

This commit is contained in:
Jakub Adamski 2019-01-10 23:53:16 +01:00
parent 036657c077
commit d41781b2c7
3 changed files with 20 additions and 0 deletions

11
Microshell/help Normal file
View File

@ -0,0 +1,11 @@
Microshell Help
-------------
General info
Author= Jakub Adamski
-------------
Working commands
help - manual
exit - ends microshell

Binary file not shown.

View File

@ -49,6 +49,15 @@ int main (){
ile = cut(argv, komenda); ile = cut(argv, komenda);
if (argv[0]==NULL) if (argv[0]==NULL)
continue; continue;
else if (!strcmp(argv[0], "help")){
if (fork() == 0){
execlp("cat", "cat", "help", NULL);
perror("execlp");
exit(EXIT_FAILURE);
}
else
wait(NULL);
}
else if (!strcmp(argv[0], "exit")) else if (!strcmp(argv[0], "exit"))
break; break;
else else