usaa25/sk1/main.c
2026-01-21 18:22:41 +01:00

27 lines
576 B
C

#include "compressor.h"
#include <stdio.h>
#include <string.h>
static void help() {
printf("Pouzitie:\n");
printf(" compressor -c infile outfile\n");
printf(" compressor -d infile outfile\n");
printf(" compressor -h\n");
}
int main(int argc, char *argv[]) {
if (argc < 2) {
help();
return 0;
}
if (!strcmp(argv[1], "-c") && argc == 4) {
compress_file(argv[2], argv[3]);
} else if (!strcmp(argv[1], "-d") && argc == 4) {
decompress_file(argv[2], argv[3]);
} else {
help();
}
return 0;
}