for (;;) { int option = getopt (argc, argv, "D"); if (option == EOF) break; switch (option) { case 'D': options.Dflag = TRUE; break; default : eprintf ("%s: -%c: invalid option\n", progname, optopt); exitcode = EXIT_FAILURE; }; };