> - while ((ret = getopt_long(argc, argv, "", longopts, &index)) != -1) { > + while ((ret = getopt_long_only(argc, argv, "d:f:m:sh", longopts, &index)) != -1) { Hmm. From the manpage: "(If the program accepts only long options, then optstring should be specified as an empty string (""), not NULL.)" So I think the empty opstring should remain. Also later in the man page: " getopt_long_only() is like getopt_long(), but '-' as well as "--" can indicate a long option." So maybe my advise to switch to getopt_long_only wasn't needed or is even not that helpful. Sorry, it's been a while since I wrote programs with non-trivial option parsing.