Skip to content

Commit

Permalink
Fix command args validation
Browse files Browse the repository at this point in the history
  • Loading branch information
yatsukhnenko committed Aug 3, 2023
1 parent 51e87e3 commit cf6c1a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion benchmarks/run
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $options = array_reduce(
);

for ($i = 1; $i < $optind; ++$i) {
if (str_starts_with($argv[$i], '-') && ! array_key_exists($argv[$i], $options)) {
if (str_starts_with($argv[$i], '-') && ! array_key_exists(explode('=', $argv[$i])[0], $options)) {
fprintf(STDERR, "\n\033[41m ERROR \033[0m Unknown option '{$argv[$i]}'.\n");
exit(1);
}
Expand Down

0 comments on commit cf6c1a5

Please sign in to comment.