From 0b0bce87c41f681e1bea8538060c31c6d5345558 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Wed, 29 Nov 2023 17:31:21 +0100 Subject: [PATCH] cansequence: also show help for option "-?" This avoids the "invalid option" error message in the auto generated man pages. | DESCRIPTION | ./cansequence: invalid option -- '?' --- cansequence.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cansequence.c b/cansequence.c index 63322b8b..5d09e8ad 100644 --- a/cansequence.c +++ b/cansequence.c @@ -273,7 +273,7 @@ int main(int argc, char **argv) { 0, 0, 0, 0 }, }; - while ((opt = getopt_long(argc, argv, "ei:pq::rvh", long_options, NULL)) != -1) { + while ((opt = getopt_long(argc, argv, "ei:pq::rvh?", long_options, NULL)) != -1) { switch (opt) { case 'e': extended = true; @@ -312,6 +312,7 @@ int main(int argc, char **argv) break; case 'h': + case '?': print_usage(basename(argv[0])); exit(EXIT_SUCCESS); break;