aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/exec.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-23 01:15:45 +0900
committernsfisis <nsfisis@gmail.com>2026-02-23 01:57:21 +0900
commita6c2b1a5854f6716ae2737707b716c8716a162df (patch)
tree92c4d9ca6e18c49aa6b15dc55ff2b1378e01a658 /crates/mozart/src/commands/exec.rs
parent9e1cc460be145dfe33a5f8d23bd9559ed4adaf26 (diff)
downloadphp-mozart-a6c2b1a5854f6716ae2737707b716c8716a162df.tar.gz
php-mozart-a6c2b1a5854f6716ae2737707b716c8716a162df.tar.zst
php-mozart-a6c2b1a5854f6716ae2737707b716c8716a162df.zip
fix(exec): use bail_silent for exit code and style binary listing
Replace std::process::exit() with bail_silent() so Rust cleanup runs properly. Style the binary listing output with console_format\! markup to match Composer's Symfony Console styling. 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.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/mozart/src/commands/exec.rs b/crates/mozart/src/commands/exec.rs
index 66bc93c..ef96939 100644
--- a/crates/mozart/src/commands/exec.rs
+++ b/crates/mozart/src/commands/exec.rs
@@ -1,4 +1,5 @@
use clap::Args;
+use mozart_core::console_format;
use std::path::{Path, PathBuf};
#[derive(Args)]
@@ -37,12 +38,15 @@ pub async fn execute(
bin_dir.display()
);
}
- println!("Available binaries:");
+ println!(
+ "{}",
+ console_format!("<comment>Available binaries:</comment>")
+ );
for (name, is_local) in &binaries {
if *is_local {
- println!("- {} (local)", name);
+ println!("{}", console_format!("<info>- {} (local)</info>", name));
} else {
- println!("- {}", name);
+ println!("{}", console_format!("<info>- {}</info>", name));
}
}
return Ok(());
@@ -100,7 +104,7 @@ pub async fn execute(
let code = status.code().unwrap_or(1);
if code != 0 {
- std::process::exit(code);
+ return Err(mozart_core::exit_code::bail_silent(code));
}
Ok(())