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/commands/about.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'crates/mozart/src/commands/about.rs') diff --git a/crates/mozart/src/commands/about.rs b/crates/mozart/src/commands/about.rs index 83332b7..9c58db3 100644 --- a/crates/mozart/src/commands/about.rs +++ b/crates/mozart/src/commands/about.rs @@ -1,5 +1,6 @@ use clap::Args; use mozart_core::console; +use mozart_core::console_format; #[derive(Args)] pub struct AboutArgs {} @@ -11,18 +12,12 @@ pub async fn execute( ) -> anyhow::Result<()> { let version = env!("CARGO_PKG_VERSION"); console.write_stdout( - &console::info(&format!( - "Mozart - Dependency Manager for PHP - version {version}" - )) - .to_string(), + &console_format!("Mozart - Dependency Manager for PHP - version {version}"), console::Verbosity::Normal, ); console.write_stdout( - &console::comment( - "Mozart is a dependency manager tracking local dependencies of your projects and libraries. -See https://getcomposer.org/ for more information.", - ) - .to_string(), + &console_format!("Mozart is a dependency manager tracking local dependencies of your projects and libraries. +See https://getcomposer.org/ for more information."), console::Verbosity::Normal, ); Ok(()) -- cgit v1.3.1