From 0742955e2cb52d644fb868b21865149d2a6438f8 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 23 Nov 2026 15:55:44 -0300 Subject: help: `pardes help ` prints what `Help ` shows (one function writes both, core/Output.zig `writeWordHelp`: the builtin's row, its whole documentation, its keys, argument, what it acts on and its `pardes do` line), and the manual's glossary prints each word's whole documentation under it (the sinks of the one table, `registry.doc`: the user's "the CLI as living documentation, like 9P, maybe sharing the source with different sinks"): `pardes help ` read the word's line of /commands, a session's or a core made here, and printed its first sentence; now a builtin of this build is answered from the table with no tree asked (runtime/main.zig `help`), the name as the registry takes it (`pardes help index` stays the tree's file), and an addon's word, which only a session knows, as before from /commands; `pardes help`, `pardes words` and /commands keep one line a word, the summary; docs/typ/style.typ's `builtin-entry` prints `text`, a paragraph a line, where it printed `doc` (the summary); tests: test/process/cli.zig's help case (`pardes help Newcol`: its row and `acts on: the session (over 9P, the root ctl)`; `pardes help Save`: `from a shell: pardes do Save [ARG]`; `pardes help Diff`: its second paragraph's `Diff `); process-test (cli: help) 1/1, core-test (docs/typ) 9/9, Debug tui; the book builds in the change that regenerates builtins-gui.json (its words need `text` too) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/process/cli.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/process/cli.zig') diff --git a/test/process/cli.zig b/test/process/cli.zig index 083ba368..bf3716a8 100644 --- a/test/process/cli.zig +++ b/test/process/cli.zig @@ -52,8 +52,12 @@ fn helpOffline(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try expectRan(try pardes(a, exe, root, &.{ "help", "attach" }), 0, "\n pardes attach box:notes ", "help attach"); try expectRan(try pardes(a, exe, root, &.{ "help", "new" }), 0, " --detach[=NAME]", "help new"); try expectRan(try pardes(a, exe, root, &.{ "help", "fs" }), 0, "usage: fs ls [PATH]", "help fs"); - try expectRan(try pardes(a, exe, root, &.{ "help", "Newcol" }), 0, "Newcol (the root ctl; SPC c n; column)", "help Newcol"); - try expectRan(try pardes(a, exe, root, &.{ "help", "Save" }), 0, "pardes do Save", "help Save"); + // A builtin: what `Help ` shows, its whole documentation. + const newcol = try pardes(a, exe, root, &.{ "help", "Newcol" }); + try expectRan(newcol, 0, "SPC c n Newcol", "help Newcol"); + try expectRan(newcol, 0, "\nacts on: the session (over 9P, the root ctl)\n", "help Newcol"); + try expectRan(try pardes(a, exe, root, &.{ "help", "Save" }), 0, "\nfrom a shell: pardes do Save [ARG]\n", "help Save"); + try expectRan(try pardes(a, exe, root, &.{ "help", "Diff" }), 0, "`Diff `", "help Diff"); try expectRan(try pardes(a, exe, root, &.{ "help", "pane/3/addr" }), 0, "pane// name body tag", "help pane/3/addr"); try expectRan(try pardes(a, exe, root, &.{ "help", "nowhere" }), 1, "is not a command, a builtin", "help nowhere"); const all = try pardes(a, exe, root, &.{ "help", "--all" }); -- cgit v1.3