From 2241a5d2dab43ee1effd17bf662597edca781977 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 02:08:53 -0300 Subject: console help: the verbs' names, so the sketch's help fits the log under them help printed the rows with their arguments, four lines of the log's five, and drat-meout's own help pushed the first out. Now it is the names (two lines), help VERB says a verb's arguments and what it does, and the sketch's lines follow. Tests: test-timing and test-control, 49/49 steps, 30/30 tests; live in the drat-meout copy over fs, `help` leaves the sketch's two lines and its own in the log. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- src/host/Console.zig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/host') diff --git a/src/host/Console.zig b/src/host/Console.zig index b1915bb..6fdfba4 100644 --- a/src/host/Console.zig +++ b/src/host/Console.zig @@ -224,15 +224,17 @@ pub fn execute(self: *Console, host: *Host, line: []const u8, now: u64) ![]const } var buf: [Line.width + 3]u8 = undefined; var w: std.Io.Writer = .fixed(&buf); + // Names only, so the sketch's help fits the log below them. + w.writeAll("help VERB says more:") catch {}; for (std.enums.values(Verb)) |v| { - if (w.end + @tagName(v).len + verbs.get(v).args.len + 3 > Line.width) { + if (w.end + @tagName(v).len + 1 > Line.width) { self.log(w.buffered()); w.end = 0; } - w.print("{s}{t}{s}{s}", .{ if (w.end == 0) "" else " | ", v, if (verbs.get(v).args.len == 0) "" else " ", verbs.get(v).args }) catch {}; + w.print(" {t}", .{v}) catch {}; } self.log(w.buffered()); - if (host.forward(self, line, now) == .unknown) self.log("help VERB says what one does. Backtick hides the console. Tab completes."); + if (host.forward(self, line, now) == .unknown) self.log("Backtick hides the console. Tab completes."); }, .overlay => { const name = arg orelse return error.ExpectedOverlay; -- cgit v1.3