mirror of
https://github.com/BoredDevNL/BoredOS.git
synced 2026-05-15 18:58:40 +00:00
Add help message for rev command usage
This commit is contained in:
parent
22530a31b1
commit
e5504c15f4
1 changed files with 6 additions and 0 deletions
|
|
@ -23,6 +23,12 @@ int main(int argc, char *argv[]) {
|
|||
printf("Wrong input, use --help for more info\n");
|
||||
return 1;
|
||||
}
|
||||
if (argc == 2 && strcmp(argv[1], "--help") == 0) {
|
||||
printf("Reverses the contents of a file or text\n");
|
||||
printf("Usage: rev [file]\n");
|
||||
printf(" echo text | rev\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
FILE *fp = fopen(argv[1], "r");
|
||||
// check if the argument is a file or not by opening it
|
||||
|
|
|
|||
Loading…
Reference in a new issue