]> gitweb.hhaalo.de Git - discspan.git/commitdiff
fix: help unknown option
authorBastian Dehn <hhaalo@arcor.de>
Mon, 9 Aug 2021 20:15:19 +0000 (22:15 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 9 Aug 2021 20:15:19 +0000 (22:15 +0200)
discspan.c
help.c

index f22e73de1e152b1b66868db3567b9b2b65f33e73..fce4b6bb06dc0b49a7af1aaa5c7d1d3de3d1385a 100644 (file)
@@ -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 3ca1895bdc7e3751654d0fa352386fcae8455dc5..32d11f111b0c857713beb387bccb9320dc63d25e 100644 (file)
--- a/help.c
+++ b/help.c
@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include "help.h"
 
-void usage()
+void useage()
 {
        printf("\nUsage: discspan <option> -i <source> -o <prefix>\n\n");
        printf("   -i <source>\tpath to source file\n");