fix: Fix command-line argument parsing order

This commit is contained in:
Utkarsh Verma 2023-11-22 15:41:31 +05:30
parent df76bd50f2
commit 5f45160b65
No known key found for this signature in database
GPG Key ID: 7A4885A7162BDF20

View File

@ -15,11 +15,11 @@ int cli_init(cli_arguments *const args, const char *const argv[],
case 'd': case 'd':
args->is_debug_mode = true; args->is_debug_mode = true;
break; break;
case 'h':
// fall through
case '?': case '?':
(void)fprintf(stderr, "error: unknown option `-%c'\n", optopt); (void)fprintf(stderr, "error: unknown option `-%c'\n", optopt);
// fall through // fall through
case 'h':
// fall through
default: default:
(void)fprintf(stderr, "usage: %s [-d]\n", BINARY); (void)fprintf(stderr, "usage: %s [-d]\n", BINARY);
return 1; return 1;