fixed getopt exitcode with invalid parameters

This commit is contained in:
Blaise Tine 2024-09-07 03:42:46 -07:00
parent 2041a4ad4a
commit a75ed78bf2
26 changed files with 57 additions and 86 deletions

View file

@ -33,13 +33,11 @@ const char* program = nullptr;
static void parse_args(int argc, char **argv) {
int c;
while ((c = getopt(argc, argv, "rh?")) != -1) {
while ((c = getopt(argc, argv, "rh")) != -1) {
switch (c) {
case 'h':
case '?':
show_usage();
exit(0);
break;
show_usage();
exit(0);
default:
show_usage();
exit(-1);