From 08b27e5edd363c016cbbfc254b4110aefd740f06 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 7 Jun 2015 12:16:31 -0500 Subject: [PATCH] wmiv: Add long command line options --help and --version. We will need --help for `make check` to work once we add a manpage. --- util/wmiv.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/util/wmiv.c b/util/wmiv.c index 45cc4e3d..90bc88d3 100755 --- a/util/wmiv.c +++ b/util/wmiv.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "config.h" #ifdef HAVE_EXIF @@ -705,7 +706,14 @@ int main(int argc, char **argv) red.red = 255; red.green = red.blue = 0; - option = getopt(argc, argv, "hv"); + static struct option long_options[] = { + {"version", no_argument, 0, 'v'}, + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} + }; + int option_index = 0; + + option = getopt_long (argc, argv, "hv", long_options, &option_index); if (option != -1) { switch (option) { case 'h': -- 2.11.4.GIT