From 77ea7fc61c307c81698904c03796c1920e7a0856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 1 Nov 2019 20:50:00 +0100 Subject: [PATCH] client: add long options for --verbose and --help --- client.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index bcd3fa6b..25dcbd27 100644 --- a/client.c +++ b/client.c @@ -40,8 +40,14 @@ main(int argc, char *const *argv) const char *const prog_name = argv[0]; + static const struct option longopts[] = { + {"version", no_argument, 0, 'v'}, + {"help", no_argument, 0, 'h'}, + {NULL, no_argument, 0, 0}, + }; + while (true) { - int c = getopt_long(argc, argv, ":hv", NULL, NULL); + int c = getopt_long(argc, argv, ":hv", longopts, NULL); if (c == -1) break;