aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/bump.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-23 15:11:36 +0900
committernsfisis <nsfisis@gmail.com>2026-02-23 15:11:36 +0900
commitd6e0c6d34449224ac3687daf551a0acfd15cee32 (patch)
treed6767718ad566542d4770d4688d9961e0f74ea3d /crates/mozart/src/commands/bump.rs
parent7e45efd8a1f488b1a684f9efe31ff39009fc9e54 (diff)
downloadphp-mozart-d6e0c6d34449224ac3687daf551a0acfd15cee32.tar.gz
php-mozart-d6e0c6d34449224ac3687daf551a0acfd15cee32.tar.zst
php-mozart-d6e0c6d34449224ac3687daf551a0acfd15cee32.zip
refactor(cli): route command output through Console abstraction
Replace direct println\!/eprintln\! calls with console.write(), console.info(), and console.write_stdout() across all command handlers to respect verbosity settings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/bump.rs')
-rw-r--r--crates/mozart/src/commands/bump.rs37
1 files changed, 19 insertions, 18 deletions
diff --git a/crates/mozart/src/commands/bump.rs b/crates/mozart/src/commands/bump.rs
index 7e74f80..957120d 100644
--- a/crates/mozart/src/commands/bump.rs
+++ b/crates/mozart/src/commands/bump.rs
@@ -1,4 +1,5 @@
use clap::Args;
+use mozart_core::console::Verbosity;
use mozart_core::console_format;
use std::collections::HashMap;
use std::path::PathBuf;
@@ -154,34 +155,34 @@ pub async fn execute(
let total_changes = require_changes.len() + require_dev_changes.len();
if total_changes == 0 {
- println!(
- "{}",
- console_format!(
+ console.write_stdout(
+ &console_format!(
"<info>No requirements to update in {}.</info>",
composer_json_path.display()
- )
+ ),
+ Verbosity::Normal,
);
return Ok(());
}
if args.dry_run {
- println!(
- "{}",
- console_format!(
+ console.write_stdout(
+ &console_format!(
"<info>{} would be updated with:</info>",
composer_json_path.display()
- )
+ ),
+ Verbosity::Normal,
);
for (name, _old, new) in &require_changes {
- println!(
- "{}",
- console_format!("<info> - require.{name}: {new}</info>")
+ console.write_stdout(
+ &console_format!("<info> - require.{name}: {new}</info>"),
+ Verbosity::Normal,
);
}
for (name, _old, new) in &require_dev_changes {
- println!(
- "{}",
- console_format!("<info> - require-dev.{name}: {new}</info>")
+ console.write_stdout(
+ &console_format!("<info> - require-dev.{name}: {new}</info>"),
+ Verbosity::Normal,
);
}
// Return exit code 1 when dry-run detects changes (useful for CI to detect un-bumped constraints)
@@ -209,12 +210,12 @@ pub async fn execute(
updated_lock.content_hash = new_hash;
updated_lock.write_to_file(&lock_path)?;
- println!(
- "{}",
- console_format!(
+ console.write_stdout(
+ &console_format!(
"<info>{} has been updated ({total_changes} changes).</info>",
composer_json_path.display()
- )
+ ),
+ Verbosity::Normal,
);
Ok(())