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

View file

@ -201,7 +201,12 @@ sub cmd-execute(@args) {
$vcpu = @args[$i].Int;
}
default {
$source-file = @args[$i];
if @args[$i].starts-with('-') {
note "$RED\Unknown option: {@args[$i]}$RESET";
exit 1;
} else {
$source-file = @args[$i];
}
}
}
$i++;