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:
@@ -3088,7 +3088,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn walker_parses_help() {
|
||||
assert_eq!(parse("help").unwrap(), Command::App(AppCommand::Help));
|
||||
assert_eq!(parse("help").unwrap(), Command::App(AppCommand::Help { topic: None }));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -6644,7 +6644,7 @@ mod dispatch_3a_tests {
|
||||
// Distinct dummy commands so a test can tell which node a walk
|
||||
// committed to (the outcome alone doesn't distinguish them).
|
||||
fn dsl_builder(_: &MatchedPath, _: &str) -> Result<Command, ValidationError> {
|
||||
Ok(Command::App(AppCommand::Help))
|
||||
Ok(Command::App(AppCommand::Help { topic: None }))
|
||||
}
|
||||
fn sql_builder(_: &MatchedPath, _: &str) -> Result<Command, ValidationError> {
|
||||
Ok(Command::App(AppCommand::Quit))
|
||||
@@ -6729,7 +6729,7 @@ mod dispatch_3a_tests {
|
||||
);
|
||||
let (outcome, cmd) = dispatch("smk dsltail", Mode::Simple, &cands);
|
||||
assert!(matches!(outcome, WalkOutcome::Match { .. }), "got {outcome:?}");
|
||||
assert_eq!(cmd, Some(Command::App(AppCommand::Help)));
|
||||
assert_eq!(cmd, Some(Command::App(AppCommand::Help { topic: None })));
|
||||
}
|
||||
|
||||
// ---- Exit-gate case 2: Advanced + SQL input → SQL match ----
|
||||
@@ -6805,7 +6805,7 @@ mod dispatch_3a_tests {
|
||||
);
|
||||
let (outcome, cmd) = dispatch("smk dsltail", Mode::Advanced, &cands);
|
||||
assert!(matches!(outcome, WalkOutcome::Match { .. }), "got {outcome:?}");
|
||||
assert_eq!(cmd, Some(Command::App(AppCommand::Help)));
|
||||
assert_eq!(cmd, Some(Command::App(AppCommand::Help { topic: None })));
|
||||
}
|
||||
|
||||
/// In advanced mode a non-shared DSL entry word (no Advanced
|
||||
|
||||
Reference in New Issue
Block a user