From: Bastian Dehn Date: Mon, 9 Aug 2021 20:15:19 +0000 (+0200) Subject: fix: help unknown option X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=40f10de9f5d81bcded62f80bd2931e43a6bb4ee1;p=discspan.git fix: help unknown option --- diff --git a/discspan.c b/discspan.c index f22e73d..fce4b6b 100644 --- a/discspan.c +++ b/discspan.c @@ -29,7 +29,7 @@ param_t readArgument(int argc, char *argv[]) const unsigned long long cd = 734003200; int c = 0; - while ((c = getopt(argc, argv, ":59bcf:i:o:")) != -1) { + while ((c = getopt(argc, argv, ":59bcf:hi:o:")) != -1) { switch (c) { case 'i': parameter.input = optarg; @@ -53,6 +53,9 @@ param_t readArgument(int argc, char *argv[]) parameter.split = atoll(optarg); break; case 'h': + useage(); + exit(0); + break; default: printf("WARNUNG: Parameter -%c unbekannt!\n", optopt); break; @@ -88,7 +91,7 @@ int main(int argc, char *argv[]) if (parameter.input == NULL || parameter.output == NULL || parameter.split < 2048) { - usage(); + useage(); exit(1); } diff --git a/help.c b/help.c index 3ca1895..32d11f1 100644 --- a/help.c +++ b/help.c @@ -1,7 +1,7 @@ #include #include "help.h" -void usage() +void useage() { printf("\nUsage: discspan