Skip to content
Snippets Groups Projects
Commit 41f7ecaf authored by Yorhel's avatar Yorhel
Browse files

Mention --ignore-config flag when reading config fails

parent f46c7ec6
No related branches found
No related tags found
No related merge requests found
...@@ -248,7 +248,7 @@ fn tryReadArgsFile(path: [:0]const u8) void { ...@@ -248,7 +248,7 @@ fn tryReadArgsFile(path: [:0]const u8) void {
var f = std.fs.cwd().openFileZ(path, .{}) catch |e| switch (e) { var f = std.fs.cwd().openFileZ(path, .{}) catch |e| switch (e) {
error.FileNotFound => return, error.FileNotFound => return,
error.NotDir => return, error.NotDir => return,
else => ui.die("Error opening {s}: {s}\n", .{ path, ui.errorString(e) }), else => ui.die("Error opening {s}: {s}\nRun with --ignore-config to skip reading config files.\n", .{ path, ui.errorString(e) }),
}; };
defer f.close(); defer f.close();
...@@ -258,7 +258,7 @@ fn tryReadArgsFile(path: [:0]const u8) void { ...@@ -258,7 +258,7 @@ fn tryReadArgsFile(path: [:0]const u8) void {
while ( while (
rd.readUntilDelimiterOrEof(&linebuf, '\n') rd.readUntilDelimiterOrEof(&linebuf, '\n')
catch |e| ui.die("Error reading from {s}: {s}\n", .{ path, ui.errorString(e) }) catch |e| ui.die("Error reading from {s}: {s}\nRun with --ignore-config to skip reading config files.\n", .{ path, ui.errorString(e) })
) |line_| { ) |line_| {
var line = std.mem.trim(u8, line_, &std.ascii.spaces); var line = std.mem.trim(u8, line_, &std.ascii.spaces);
if (line.len == 0 or line[0] == '#') continue; if (line.len == 0 or line[0] == '#') continue;
...@@ -272,7 +272,7 @@ fn tryReadArgsFile(path: [:0]const u8) void { ...@@ -272,7 +272,7 @@ fn tryReadArgsFile(path: [:0]const u8) void {
var args = Args.init(arglist.items); var args = Args.init(arglist.items);
while (args.next()) |opt| { while (args.next()) |opt| {
if (!argConfig(&args, opt)) if (!argConfig(&args, opt))
ui.die("Unrecognized option in config file '{s}': {s}.\n", .{path, opt.val}); ui.die("Unrecognized option in config file '{s}': {s}.\nRun with --ignore-config to skip reading config files.\n", .{path, opt.val});
} }
for (arglist.items) |i| allocator.free(i); for (arglist.items) |i| allocator.free(i);
arglist.deinit(); arglist.deinit();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment