lotto.c
changeset 85 9568a180fc43
parent 77 49e0babccb23
--- a/lotto.c
+++ b/lotto.c
@@ -159,7 +159,16 @@
     num = 6;
     max = ONESECOND;
 
-    while ((i = getopt (argc, argv, "m:e:n:vwh")) >= 0) {
+    struct option options[] = {
+        {"max", 1, 0, 'm'},
+        {"end", 1, 0, 'e'},
+        {"numbers", 1, 0, 'n'},
+        {"verbose", 0, 0, 'v'},
+        {"wide", 0, 0, 'w'},
+        {"help", 0, 0, 'h'},
+    };
+
+    while ((i = getopt_long_only (argc, argv, "m:e:n:vwh", options, NULL)) != -1) {
         switch (i) {
         case 'm':
             max = atol (optarg);