feat: H3 help <command> per-command detail + general reference
HELP node takes an optional single-word topic (BarePath);
AppCommand::Help { topic }. note_help_topic renders the help
block(s) of every command sharing that entry word (so `help
create` covers both create forms), plus `help types` and a
friendly "no help for X" pointer for unknown topics. Full help
gains a detail-hint footer. Catalogued help.detail_hint /
help.unknown_topic; parse-error matrix updated (help now takes a
topic, so the near-miss is the multi-word case). 9 integration
tests in tests/it/help_command.rs. Mark H3 [x].
This commit is contained in:
@@ -174,6 +174,8 @@ pub const KEYS_AND_PLACEHOLDERS: &[(&str, &[&str])] = &[
|
||||
("help.intro", &[]),
|
||||
("help.dsl_section", &[]),
|
||||
("help.types_reference", &[]),
|
||||
("help.detail_hint", &[]),
|
||||
("help.unknown_topic", &["topic"]),
|
||||
("help.app.quit", &[]),
|
||||
("help.app.help", &[]),
|
||||
("help.app.rebuild", &[]),
|
||||
|
||||
@@ -238,6 +238,10 @@ help:
|
||||
# per line so scroll math stays accurate.
|
||||
intro: "Supported commands:"
|
||||
dsl_section: "DSL data commands (in simple mode):"
|
||||
# H3: footer on the full `help` list, and the not-found note
|
||||
# for `help <topic>`. `{topic}` is the word the user typed.
|
||||
detail_hint: "Type `help <command>` for detail on one command (e.g. `help insert`), or `help types` for the type reference."
|
||||
unknown_topic: "No help for `{topic}`. Type `help` for the full command list, or `help types` for the type reference."
|
||||
# Per-command help, keyed by `CommandNode.help_id`. Block
|
||||
# scalars (`|-`) so the column alignment survives — the
|
||||
# double-quoted form trips a libyml scanner bug on long
|
||||
@@ -248,6 +252,7 @@ help:
|
||||
quit — exit the app
|
||||
help: |-
|
||||
help — show this command list
|
||||
help <command> — detailed help for one command (e.g. `help insert`)
|
||||
rebuild: |-
|
||||
rebuild — rebuild the project database from project.yaml + data/ (with confirmation)
|
||||
save: |-
|
||||
@@ -582,7 +587,7 @@ parse:
|
||||
# listing in `help.in_app_body` carries the user-facing
|
||||
# description.
|
||||
quit: "quit"
|
||||
help: "help"
|
||||
help: "help [<command>]"
|
||||
rebuild: "rebuild"
|
||||
save: "save | save as"
|
||||
new: "new"
|
||||
|
||||
Reference in New Issue
Block a user