Fix missing arg count check

This commit is contained in:
Dylan K. Taylor 2024-10-17 20:24:57 +01:00
parent 5241118f0b
commit c8f567b093
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -745,6 +745,10 @@ function main(array $argv) : int{
}
$callback = $options[$selected][1];
if(count($argv) !== count($options[$selected][0]) + 2){
fwrite(STDERR, "Usage: {$argv[0]} $selected " . implode(" ", array_map(fn(string $a) => "<$a>", $options[$selected][0])) . "\n");
return 1;
}
return $callback($argv);
}