mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
wmiv: Add long command line options --help and --version.
We will need --help for `make check` to work once we add a manpage.
This commit is contained in:
committed by
Carlos R. Mafra
parent
9bd400db67
commit
08b27e5edd
10
util/wmiv.c
10
util/wmiv.c
@@ -34,6 +34,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <getopt.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef HAVE_EXIF
|
#ifdef HAVE_EXIF
|
||||||
@@ -705,7 +706,14 @@ int main(int argc, char **argv)
|
|||||||
red.red = 255;
|
red.red = 255;
|
||||||
red.green = red.blue = 0;
|
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) {
|
if (option != -1) {
|
||||||
switch (option) {
|
switch (option) {
|
||||||
case 'h':
|
case 'h':
|
||||||
|
|||||||
Reference in New Issue
Block a user