From 7cf2c9947ce0a5529b15835b7e1eecb30a2e68c2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 14:06:59 -0300 Subject: Not-found failures say it once, in plain words: grep: pattern not found, callers not found The ENOENT that 9ns reads from a failure's words came from a tacked-on suffix, grep: no match, not found, definition: nothing found, not found, no shell "x", not found. They now say it once: grep: pattern not found, find: name not found, Callers: callers not found, definition: not found, shell "x" not found (...). Co-Authored-By: Claude Opus 5.5 --- src/host_io.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/host_io.zig') diff --git a/src/host_io.zig b/src/host_io.zig index bbd664a9..9e3fbf79 100644 --- a/src/host_io.zig +++ b/src/host_io.zig @@ -933,7 +933,7 @@ pub const Shell = struct { if (libc.access(@ptrCast(&buf), 0) == 0) return std.fmt.bufPrint(said, "not a shell: {s} is not executable", .{bin}) catch "not a shell: not executable"; } // "not found": the words a mount reads as ENOENT. - return std.fmt.bufPrint(said, "no shell \"{s}\", not found (a name on the usual paths, or a path to one)", .{bin}) catch "no such shell"; + return std.fmt.bufPrint(said, "shell \"{s}\" not found (a name on the usual paths, or a path to one)", .{bin}) catch "no such shell"; } /// The program a script's `#!` line names, when it is not there to @@ -970,7 +970,7 @@ pub const Shell = struct { var said: [320]u8 = undefined; try std.testing.expectEqualStrings("interpreter /no/such/interp not found", refusal(try std.fmt.bufPrint(&path, "{s}/bad", .{dir}), &said).?); try std.testing.expect(refusal(try std.fmt.bufPrint(&path, "{s}/good", .{dir}), &said) == null); - try std.testing.expect(std.mem.startsWith(u8, refusal(try std.fmt.bufPrint(&path, "{s}/none", .{dir}), &said).?, "no shell ")); + try std.testing.expect(std.mem.startsWith(u8, refusal(try std.fmt.bufPrint(&path, "{s}/none", .{dir}), &said).?, "shell \"")); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "plain", .data = "echo\n" }); const plain = try std.fmt.bufPrint(&path, "{s}/plain", .{dir}); try std.testing.expect(std.mem.endsWith(u8, refusal(plain, &said).?, "plain is not executable")); -- cgit v1.3