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:
parent
c6813e5a18
commit
35b3ab615a
19 changed files with 100 additions and 17 deletions
7
un.raku
7
un.raku
|
|
@ -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++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue