fix: surface macro parse errors on top-level invocation

An invalid installed macro invoked as a top-level command fell through
to the generic unknown-command error, while .macro <name> reported the
parse/validation failure. Both paths now surface the reason.
This commit is contained in:
2026-08-21 11:55:14 -06:00
parent 03687c8981
commit b43acac8ee
+3
View File
@@ -1337,6 +1337,9 @@ pub async fn run_repl_command(
"Macro '{name}' is restricted by {} enabled_macros",
ctx.macro_lock_owner(*level)
),
Some(MacroState::Invalid { reason }) => {
bail!("Macro '{name}' is invalid: {reason}")
}
_ => unknown_command()?,
}
}