From 6f3802fd9f39c4e5847d130b4417b5cdfb66972d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 22 Feb 2026 22:53:09 +0900 Subject: refactor(console): add console_format! proc macro and migrate all commands Introduce a Symfony Console-style tag macro that replaces verbose patterns like `console::info(&format!("text {name}"))` with `console_format!("text {name}")`. Supports all 6 tag types (info, comment, error, question, highlight, warning) with format argument distribution across multiple tagged segments. Co-Authored-By: Claude Opus 4.6 --- crates/mozart/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/mozart/src/main.rs') diff --git a/crates/mozart/src/main.rs b/crates/mozart/src/main.rs index 04dd6d1..ed7c4ad 100644 --- a/crates/mozart/src/main.rs +++ b/crates/mozart/src/main.rs @@ -48,13 +48,16 @@ async fn main() { if let Some(mozart_err) = e.downcast_ref::() { // Only print a message when there is one (bail_silent produces empty message). if !mozart_err.message.is_empty() { - eprintln!("{}", mozart_core::console::error(&mozart_err.message)); + eprintln!( + "{}", + mozart_core::console_format!("{}", mozart_err.message) + ); } std::process::exit(mozart_err.exit_code); } // Generic anyhow error — print and exit with GENERAL_ERROR. - eprintln!("{}", mozart_core::console::error(&format!("{e:#}"))); + eprintln!("{}", mozart_core::console_format!("{e:#}")); std::process::exit(exit_code::GENERAL_ERROR); } } -- cgit v1.3.1