]> gitweb.hhaalo.de Git - discspan.git/commitdiff
add long opts
authorBastian Dehn <hhaalo@arcor.de>
Wed, 24 Sep 2025 08:45:14 +0000 (10:45 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Wed, 24 Sep 2025 08:45:14 +0000 (10:45 +0200)
src/discspan.c

index 1b631b7a55210d424fd806f577e2ce475e27130f..1d29a64994d906dd7655ca46b53a2ca6a64416e6 100644 (file)
@@ -58,9 +58,26 @@ int main(int argc, char* argv[])
        char* output = NULL;
        uint64_t split = 0;
 
-       uint32_t c = 0;
-       while ((c = getopt(argc, argv, ":59bcf:hi:o:v")) != -1) {
-               switch (c) {
+       struct option loption[] = {
+               { "input", required_argument, 0, 'i' },
+               { "output", required_argument, 0, 'o' },
+               { "dvd5", no_argument, 0, '5' },
+               { "dvd9", no_argument, 0, '9' },
+               { "bluray", no_argument, 0, 'b' },
+               { "cd", no_argument, 0, 'c' },
+               { "help", no_argument, 0, 'h' },
+               { "version", no_argument, 0, 'v' },
+               { "free-size", required_argument, 0, 'f' }
+       };
+
+       int32_t opt_index = 0;
+       int32_t opt_value = 0;
+       for (uint32_t i = 0; i < argc; i++) {
+               opt_index = 0;
+               opt_value = getopt_long(argc, argv, "i:o:59bcfhv", loption, &opt_index);
+               switch (opt_value) {
+               case -1:
+                       break;
                case 'i':
                        input = optarg;
                        break;