Skip to content

Commit

Permalink
cansequence: also show help for option "-?"
Browse files Browse the repository at this point in the history
This avoids the "invalid option" error message in the auto generated
man pages.

| DESCRIPTION
|       ./cansequence: invalid option -- '?'
  • Loading branch information
marckleinebudde committed Nov 29, 2023
1 parent e8a808e commit 0b0bce8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cansequence.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -312,6 +312,7 @@ int main(int argc, char **argv)
break;

case 'h':
case '?':
print_usage(basename(argv[0]));
exit(EXIT_SUCCESS);
break;
Expand Down

0 comments on commit 0b0bce8

Please sign in to comment.