Return 1 on unrecognized option

This commit is contained in:
Arun Prakash Jana 2018-11-28 08:18:01 +05:30
parent 2a4cc85659
commit 8cba83f43f
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 4 additions and 2 deletions

View File

@ -3437,7 +3437,6 @@ static void usage(void)
" -v show program version\n"
" -h show this help\n\n"
"Version: %s\n%s\n", VERSION, GENERAL_INFO);
exit(0);
}
int main(int argc, char *argv[])
@ -3494,9 +3493,12 @@ int main(int argc, char *argv[])
case 'v':
fprintf(stdout, "%s\n", VERSION);
return 0;
case 'h': // fallthrough
case 'h':
usage();
return 0;
default:
usage();
exit(1);
}
}