diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-06 04:02:24 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-06 04:05:13 +0900 |
| commit | 2bc47940be9359e34cfe50c64fe76234999bc716 (patch) | |
| tree | 52859450ba8704df79d22917aa132fc5b3a702a6 /crates/mozart/src/commands/outdated.rs | |
| parent | bf96f8292c0e9818c8b5fc8713ca7506e4338a49 (diff) | |
| download | php-mozart-2bc47940be9359e34cfe50c64fe76234999bc716.tar.gz php-mozart-2bc47940be9359e34cfe50c64fe76234999bc716.tar.zst php-mozart-2bc47940be9359e34cfe50c64fe76234999bc716.zip | |
refactor(console): rename color helpers and migrate call sites to console_format!
The six tag-style color functions (info, comment, error, question,
highlight, warning) are pub only so that console_format! can call them
from generated code; they are not part of the public API. Rename them
to __format_*_message to make that intent visible, add a doc-comment
saying not to call them directly, and replace every remaining direct
call site with console_format!.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/outdated.rs')
| -rw-r--r-- | crates/mozart/src/commands/outdated.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/crates/mozart/src/commands/outdated.rs b/crates/mozart/src/commands/outdated.rs index 2b25816..46f09f9 100644 --- a/crates/mozart/src/commands/outdated.rs +++ b/crates/mozart/src/commands/outdated.rs @@ -1,5 +1,6 @@ use clap::Args; use indexmap::IndexSet; +use mozart_core::console_format; use mozart_core::console_writeln; use mozart_core::matches_wildcard; use std::cmp::Ordering; @@ -442,7 +443,7 @@ fn render_text(entries: &[OutdatedEntry], console: &mozart_core::console::Consol if entries.is_empty() { console_writeln!( console, - &mozart_core::console::info("All packages are up to date.").to_string(), + &console_format!("<info>All packages are up to date.</info>"), ); return; } @@ -467,16 +468,16 @@ fn render_text(entries: &[OutdatedEntry], console: &mozart_core::console::Consol let (name_str, lat_str) = match entry.category { UpdateCategory::UpToDate => ( - mozart_core::console::info(&name_col).to_string(), - mozart_core::console::info(&lat_col).to_string(), + console_format!("<info>{name_col}</info>"), + console_format!("<info>{lat_col}</info>"), ), UpdateCategory::SemverCompatible => ( - mozart_core::console::highlight(&name_col).to_string(), - mozart_core::console::highlight(&lat_col).to_string(), + console_format!("<highlight>{name_col}</highlight>"), + console_format!("<highlight>{lat_col}</highlight>"), ), UpdateCategory::SemverIncompatible => ( - mozart_core::console::comment(&name_col).to_string(), - mozart_core::console::comment(&lat_col).to_string(), + console_format!("<comment>{name_col}</comment>"), + console_format!("<comment>{lat_col}</comment>"), ), }; @@ -485,7 +486,7 @@ fn render_text(entries: &[OutdatedEntry], console: &mozart_core::console::Consol &format!( "{} {} {} {}", name_str, - mozart_core::console::comment(&cur_col), + console_format!("<comment>{cur_col}</comment>"), lat_str, entry.description ), |
