diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-23 15:55:44 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-23 15:58:03 -0300 |
| commit | 0742955e2cb52d644fb868b21865149d2a6438f8 (patch) | |
| tree | 0fbe9bd6cdfd1eb753a1e6f2c1c8869b606c245f /runtime/main.zig | |
| parent | 544d7265a8527be11ad9e8f944fa3723ae113a31 (diff) | |
| download | pardes-0742955e2cb52d644fb868b21865149d2a6438f8.tar.gz pardes-0742955e2cb52d644fb868b21865149d2a6438f8.zip | |
help: `pardes help <Word>` prints what `Help <Word>` 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 <Word>` 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 <hash>`); 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 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'runtime/main.zig')
| -rw-r--r-- | runtime/main.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/main.zig b/runtime/main.zig index 5cdf5ee0..8558e25f 100644 --- a/runtime/main.zig +++ b/runtime/main.zig @@ -879,6 +879,12 @@ fn help(init: std.process.Init, out: *std.Io.Writer, args: []const []const u8, s writeLeaf(out, c) catch {}; return 0; } + // A builtin of this build: what `Help <Word>` shows, its whole + // documentation (builtins.registry.doc) and what the list does not say. + if (std.meta.stringToEnum(pardes.builtins.registry.Builtin(), what)) |b| { + pardes.panes.Output.writeWordHelp(out, b) catch {}; + return 0; + } const t = readTree(init, session); const commands = t.read(arena, "commands") catch ""; if (Word.find(commands, what)) |w| { |
