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
6
un.zig
6
un.zig
|
|
@ -621,7 +621,11 @@ pub fn main() !u8 {
|
|||
// Execute mode - find source file
|
||||
var source_file: ?[]const u8 = null;
|
||||
for (args[1..]) |arg| {
|
||||
if (!mem.startsWith(u8, arg, "-")) {
|
||||
if (mem.startsWith(u8, arg, "-")) {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("{s}Unknown option: {s}{s}\n", .{ RED, arg, RESET }) catch {};
|
||||
std.os.exit(1);
|
||||
} else {
|
||||
source_file = arg;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue