aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-06 18:23:37 +0900
committernsfisis <nsfisis@gmail.com>2026-05-06 19:49:08 +0900
commit706f579477b5aa2bd287f9aa674281580b4f5433 (patch)
treea4a5701345b8111e308f1f5a0255d04897f50aea
parent3d128352f93c4416d087069947920e9fa864df7d (diff)
downloadphp-mozart-706f579477b5aa2bd287f9aa674281580b4f5433.tar.gz
php-mozart-706f579477b5aa2bd287f9aa674281580b4f5433.tar.zst
php-mozart-706f579477b5aa2bd287f9aa674281580b4f5433.zip
fix(status): remove conflicting local verbose arg
The StatusArgs struct redefined `verbose` as bool while Cli defines a global `verbose: u8` with ArgAction::Count. clap's runtime type check panicked on access. Drop the local field and rely on cli.verbose, which matches Composer's StatusCommand treating -v|-vv|-vvv as a single flag. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
-rw-r--r--crates/mozart/src/commands/status.rs10
-rw-r--r--crates/mozart/tests/cli_all.rs48
2 files changed, 51 insertions, 7 deletions
diff --git a/crates/mozart/src/commands/status.rs b/crates/mozart/src/commands/status.rs
index c2f0d69..c22fd3c 100644
--- a/crates/mozart/src/commands/status.rs
+++ b/crates/mozart/src/commands/status.rs
@@ -5,11 +5,7 @@ use sha1::{Digest, Sha1};
use std::path::{Path, PathBuf};
#[derive(Args)]
-pub struct StatusArgs {
- /// Show a list of files for each modified package (implied by -v)
- #[arg(short, long)]
- pub verbose: bool,
-}
+pub struct StatusArgs {}
/// Information extracted from a package's dist field.
struct DistInfo {
@@ -43,7 +39,7 @@ struct PackageStatus {
}
pub async fn execute(
- args: &StatusArgs,
+ _args: &StatusArgs,
cli: &super::Cli,
console: &mozart_core::console::Console,
) -> anyhow::Result<()> {
@@ -60,7 +56,7 @@ pub async fn execute(
let cache_config = mozart_registry::cache::build_cache_config(cli.no_cache);
let files_cache = mozart_registry::cache::Cache::files(&cache_config);
- let show_files = args.verbose || cli.verbose > 0;
+ let show_files = cli.verbose > 0;
let mut modified_packages: Vec<PackageStatus> = Vec::new();
diff --git a/crates/mozart/tests/cli_all.rs b/crates/mozart/tests/cli_all.rs
new file mode 100644
index 0000000..2376d04
--- /dev/null
+++ b/crates/mozart/tests/cli_all.rs
@@ -0,0 +1,48 @@
+mod common;
+
+macro_rules! test_help {
+ ($func_name:ident, $command_name:literal) => {
+ #[test]
+ fn $func_name() {
+ $crate::common::mozart_cmd()
+ .arg($command_name)
+ .arg("--help")
+ .assert()
+ .success();
+ }
+ };
+}
+
+test_help!(test_about_help, "about");
+test_help!(test_archive_help, "archive");
+test_help!(test_audit_help, "audit");
+test_help!(test_browse_help, "browse");
+test_help!(test_bump_help, "bump");
+test_help!(test_check_platform_reqs_help, "check-platform-reqs");
+test_help!(test_clear_cache_help, "clear-cache");
+test_help!(test_completion_help, "completion");
+test_help!(test_config_help, "config");
+test_help!(test_create_project_help, "create-project");
+test_help!(test_depends_help, "depends");
+test_help!(test_diagnose_help, "diagnose");
+test_help!(test_dump_autoload_help, "dump-autoload");
+test_help!(test_exec_help, "exec");
+test_help!(test_fund_help, "fund");
+test_help!(test_global_help, "global");
+test_help!(test_init_help, "init");
+test_help!(test_install_help, "install");
+test_help!(test_licenses_help, "licenses");
+test_help!(test_outdated_help, "outdated");
+test_help!(test_prohibits_help, "prohibits");
+test_help!(test_reinstall_help, "reinstall");
+test_help!(test_remove_help, "remove");
+test_help!(test_repository_help, "repository");
+test_help!(test_require_help, "require");
+test_help!(test_run_script_help, "run-script");
+test_help!(test_search_help, "search");
+test_help!(test_self_update_help, "self-update");
+test_help!(test_show_help, "show");
+test_help!(test_status_help, "status");
+test_help!(test_suggests_help, "suggests");
+test_help!(test_update_help, "update");
+test_help!(test_validate_help, "validate");