if no argv, then don't load CLI args

This commit is contained in:
Mitchell Hashimoto
2023-03-20 15:51:27 -07:00
parent fe034fe524
commit 0cd6e08ca3

View File

@ -562,6 +562,13 @@ pub const Config = struct {
/// Load and parse the CLI args.
pub fn loadCliArgs(self: *Config, alloc_gpa: Allocator) !void {
switch (builtin.os.tag) {
.windows => {},
// Fast-path if we are non-Windows and no args, do nothing.
else => if (std.os.argv.len <= 1) return,
}
// Parse the config from the CLI args
var iter = try std.process.argsWithAllocator(alloc_gpa);
defer iter.deinit();