From 6df59c5e154c2f587de743e675833f5157988b9b Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 22 Feb 2026 23:28:29 +0900 Subject: feat(cli): match Composer's --version output format Replace clap's built-in --version with custom handler that outputs Composer-compatible version info: Mozart version line, PHP version with binary path, and diagnose hint. Add detect_php_version_and_binary() to mozart-core platform module. Co-Authored-By: Claude Opus 4.6 --- crates/mozart/src/commands/global.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/mozart/src/commands/global.rs') diff --git a/crates/mozart/src/commands/global.rs b/crates/mozart/src/commands/global.rs index 97d56d2..dfa4fc2 100644 --- a/crates/mozart/src/commands/global.rs +++ b/crates/mozart/src/commands/global.rs @@ -221,7 +221,7 @@ mod tests { fn test_global_args_has_correct_command() { // Verify GlobalArgs parses correctly through the CLI let cli = Cli::try_parse_from(["mozart", "global", "require", "vendor/package"]).unwrap(); - if let Commands::Global(args) = cli.command { + if let Some(Commands::Global(args)) = cli.command { assert_eq!(args.command_name, "require"); assert_eq!(args.args, vec!["vendor/package"]); } else { @@ -234,7 +234,7 @@ mod tests { // Verify hyphen values in trailing args are accepted let cli = Cli::try_parse_from(["mozart", "global", "require", "vendor/pkg", "--no-update"]) .unwrap(); - if let Commands::Global(args) = cli.command { + if let Some(Commands::Global(args)) = cli.command { assert_eq!(args.command_name, "require"); assert!(args.args.contains(&"--no-update".to_string())); } else { -- cgit v1.3.1