client: add long options for --verbose and --help

This commit is contained in:
Daniel Eklöf 2019-11-01 20:50:00 +01:00
parent 8b4ef78f7a
commit 77ea7fc61c
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -40,8 +40,14 @@ main(int argc, char *const *argv)
const char *const prog_name = argv[0]; 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) { while (true) {
int c = getopt_long(argc, argv, ":hv", NULL, NULL); int c = getopt_long(argc, argv, ":hv", longopts, NULL);
if (c == -1) if (c == -1)
break; break;