Fix: catch unknown flags in session command before API request

Previously, invalid flags like --invalid-flag were silently ignored,
causing the CLI to make API requests that returned confusing
'timestamp expired' errors. Now prints 'Unknown option' and exits.

Fixed in 21 implementations: rb, pl, php, lua, sh, cpp, d, rs, zig,
v, kt, groovy, dart, cr, raku, ps1, m, nim, hs
This commit is contained in:
Russell Ballestrini 2026-01-03 12:26:38 -05:00
parent c6813e5a18
commit 35b3ab615a
19 changed files with 100 additions and 17 deletions

5
un.php
View file

@ -722,7 +722,10 @@ function main() {
$options['extend'] = true;
break;
default:
if (!str_starts_with($arg, '-')) {
if (str_starts_with($arg, '-')) {
fwrite(STDERR, RED . "Unknown option: $arg" . RESET . "\n");
exit(1);
} else {
$options['source_file'] = $arg;
}
break;