Merge pull request #451 from SebastianKeller/fix_build_master
Fix build on zig master (0.10.0-dev.500+66cf011aa)
This commit is contained in:
commit
655a013db2
10
src/main.zig
10
src/main.zig
@ -1654,16 +1654,13 @@ pub fn main() anyerror!void {
|
|||||||
defer analysis.deinit();
|
defer analysis.deinit();
|
||||||
|
|
||||||
// Check arguments.
|
// Check arguments.
|
||||||
var args_it = std.process.args();
|
var args_it = try std.process.ArgIterator.initWithAllocator(allocator);
|
||||||
defer args_it.deinit();
|
defer args_it.deinit();
|
||||||
const prog_name = (try args_it.next(allocator)) orelse @panic("Could not find self argument");
|
if(!args_it.skip()) @panic("Could not find self argument");
|
||||||
allocator.free(prog_name);
|
|
||||||
|
|
||||||
var config_path: ?[]const u8 = null;
|
var config_path: ?[]const u8 = null;
|
||||||
var next_arg_config_path = false;
|
var next_arg_config_path = false;
|
||||||
while (try args_it.next(allocator)) |arg| {
|
while (args_it.next()) |arg| {
|
||||||
defer allocator.free(arg);
|
|
||||||
|
|
||||||
if (next_arg_config_path) {
|
if (next_arg_config_path) {
|
||||||
config_path = try allocator.dupe(u8, arg);
|
config_path = try allocator.dupe(u8, arg);
|
||||||
next_arg_config_path = false;
|
next_arg_config_path = false;
|
||||||
@ -1684,6 +1681,7 @@ pub fn main() anyerror!void {
|
|||||||
std.os.exit(1);
|
std.os.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next_arg_config_path) {
|
if (next_arg_config_path) {
|
||||||
std.debug.print("Expected configuration file path after --config-path argument\n", .{});
|
std.debug.print("Expected configuration file path after --config-path argument\n", .{});
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user