diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-12-27 12:44:23 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-12-27 12:44:23 +0000 |
commit | cdd7f2f950b82dbf1921e6ac9c67ad899ad3e143 (patch) | |
tree | 7f09b345e3bd67456112e112e1ee5fec26a8157f | |
parent | 871c14693e084d4b6ce6ac1786dd08a124185bb6 (diff) | |
download | netsurf-cdd7f2f950b82dbf1921e6ac9c67ad899ad3e143.tar.gz netsurf-cdd7f2f950b82dbf1921e6ac9c67ad899ad3e143.tar.bz2 |
allow for framebuffer command line parsing to cope with unknown long options
-rw-r--r-- | framebuffer/gui.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/framebuffer/gui.c b/framebuffer/gui.c index 9f6a798be..fab655e1e 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -22,6 +22,7 @@ #include <sys/ioctl.h> #include <limits.h> #include <unistd.h> +#include <getopt.h> #include <assert.h> #include <string.h> #include <stdbool.h> @@ -451,6 +452,10 @@ static bool process_cmdline(int argc, char** argv) { int opt; + int option_index; + static struct option long_options[] = { + {0, 0, 0, 0 } + }; /* no long options */ LOG(("argc %d, argv %p", argc, argv)); @@ -473,7 +478,8 @@ process_cmdline(int argc, char** argv) feurl = NETSURF_HOMEPAGE; } - while((opt = getopt(argc, argv, "f:b:w:h:")) != -1) { + while((opt = getopt_long(argc, argv, "f:b:w:h:", + long_options, &option_index)) != -1) { switch (opt) { case 'f': fename = optarg; |