client: let getopt_long(3) print error messages

Closes #191
This commit is contained in:
Daniel Eklöf 2020-11-10 19:04:20 +01:00
parent 3fa3c58c8b
commit c9de30e2bc
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -78,7 +78,7 @@ main(int argc, char *const *argv)
bool hold = false;
while (true) {
int c = getopt_long(argc, argv, "+:t:a:s:l::hv", longopts, NULL);
int c = getopt_long(argc, argv, "+t:a:s:l::hv", longopts, NULL);
if (c == -1)
break;
@ -138,12 +138,7 @@ main(int argc, char *const *argv)
print_usage(prog_name);
return EXIT_SUCCESS;
case ':':
fprintf(stderr, "error: -%c: missing required argument\n", optopt);
return EXIT_FAILURE;
case '?':
fprintf(stderr, "error: -%c: invalid option\n", optopt);
return EXIT_FAILURE;
}
}