This commit is contained in:
Bohdan Kapliuk 2025-01-12 16:54:22 +02:00
parent 5e00520712
commit 20a717c3cd

View File

@ -13,21 +13,20 @@ void print_help() {
}
int main(int argc, char* argv[]) {
int result = 1;
if (argc < 2) {
fprintf(stderr, "Chyba: Chybaju argumenty. Pouzite -h pre zobrazenie pomoci.\n");
result = 0;
return -1;
}
if (strcmp(argv[1], "-h") == 0) {
print_help();
result = 0;
return -1;
}
if ((strcmp(argv[1], "-c") == 0 || strcmp(argv[1], "-d") == 0 ||
strcmp(argv[1], "-c2") == 0 || strcmp(argv[1], "-d2") == 0) && argc != 4) {
fprintf(stderr, "Chyba: Nespravny pocet argumentov. Pouzite -h pre zobrazenie pomoci.\n");
result = 0;
return -1;
}
const char* input_file = argv[2];