Expand description
The slash commands, in one table.
The plain REPL, the full-screen interface, /help, and Tab completion all read
COMMANDS. Before this the set lived in three places — the REPL’s match, the
interface’s match, and two hand-written /help strings — and they had already drifted:
the REPL’s help named four commands and the interface’s named seven.
What the table does not hold is what a command does. Each front end keeps a plain
match on the canonical name, because the handlers need different things (the REPL prints,
the interface posts notes and asks its loop to open pickers, the server answers with events),
and a table of closures would need a shared context type that fits none of them. The drift
test in each front end closes the gap instead: every command the table says it serves must be
handled there.
It lives here, in core, because there are three front ends now. The dashboard parses the same
lines (#254), and a table the server cannot read is a table the browser has to copy.
Structs§
Enums§
- Args
- Whether a command takes an argument, and how
/helpspells it. - Completion
- Front
- Which interface has a command.
- Parsed
- A line that starts with
/, resolved against whatfronthas.
Constants§
- COMMANDS
- Every slash command, in the order
/helpand the menu list them.
Functions§
- complete
- What Tab does to
line. Only while the command word is being typed: the line starts with/and has no whitespace yet. Anything else — prose, or an argument — isNone, so Tab stays whatever the editor already made it. - help
- The
/helpbody forfront: one line per command, in table order. - is_
command_ word - Whether
lineis a command word being typed: a leading/and no whitespace yet. - lookup
- The command a word names, by canonical name or alias, exactly.
- matching
- The commands whose name or an alias starts with
prefix, in table order, thatfronthas. - parse