diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-23 15:11:36 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-23 15:11:36 +0900 |
| commit | d6e0c6d34449224ac3687daf551a0acfd15cee32 (patch) | |
| tree | d6767718ad566542d4770d4688d9961e0f74ea3d /crates/mozart/src/commands/exec.rs | |
| parent | 7e45efd8a1f488b1a684f9efe31ff39009fc9e54 (diff) | |
| download | php-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/exec.rs')
| -rw-r--r-- | crates/mozart/src/commands/exec.rs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/crates/mozart/src/commands/exec.rs b/crates/mozart/src/commands/exec.rs index ef96939..350ff5c 100644 --- a/crates/mozart/src/commands/exec.rs +++ b/crates/mozart/src/commands/exec.rs @@ -21,8 +21,9 @@ pub struct ExecArgs { pub async fn execute( args: &ExecArgs, cli: &super::Cli, - _console: &mozart_core::console::Console, + console: &mozart_core::console::Console, ) -> anyhow::Result<()> { + use mozart_core::console::Verbosity; let working_dir = match &cli.working_dir { Some(dir) => PathBuf::from(dir), None => std::env::current_dir()?, @@ -38,15 +39,21 @@ pub async fn execute( bin_dir.display() ); } - println!( - "{}", - console_format!("<comment>Available binaries:</comment>") + console.write_stdout( + &console_format!("<comment>Available binaries:</comment>"), + Verbosity::Normal, ); for (name, is_local) in &binaries { if *is_local { - println!("{}", console_format!("<info>- {} (local)</info>", name)); + console.write_stdout( + &console_format!("<info>- {} (local)</info>", name), + Verbosity::Normal, + ); } else { - println!("{}", console_format!("<info>- {}</info>", name)); + console.write_stdout( + &console_format!("<info>- {}</info>", name), + Verbosity::Normal, + ); } } return Ok(()); |
