From ea1d072f52665b2c0b38996b04c5d87d48c8a690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 29 Dec 2019 18:35:06 +0100 Subject: [PATCH] main: let getopt_long() print error message --- main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/main.c b/main.c index a4855609..da6bc0b7 100644 --- a/main.c +++ b/main.c @@ -109,7 +109,7 @@ main(int argc, char *const *argv) const char *conf_server_socket_path = NULL; while (true) { - int c = getopt_long(argc, argv, ":c:tf:g:s::vh", longopts, NULL); + int c = getopt_long(argc, argv, "c:tf:g:s::vh", longopts, NULL); if (c == -1) break; @@ -170,12 +170,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; } }