diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-11 16:57:41 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-11 17:03:56 +0900 |
| commit | 08a845acdd831a9de186696b9614ee397c8e7c68 (patch) | |
| tree | e8d388129d1ae54a434259ff6f63ec9292ff786d | |
| parent | f641eb0202d974c765782f767f21aef2ea2fb4e9 (diff) | |
| download | php-mozart-08a845acdd831a9de186696b9614ee397c8e7c68.tar.gz php-mozart-08a845acdd831a9de186696b9614ee397c8e7c68.tar.zst php-mozart-08a845acdd831a9de186696b9614ee397c8e7c68.zip | |
change commands::*::execute() signatures
34 files changed, 68 insertions, 68 deletions
diff --git a/crates/mozart/src/commands.rs b/crates/mozart/src/commands.rs index f31dd44..8232a86 100644 --- a/crates/mozart/src/commands.rs +++ b/crates/mozart/src/commands.rs @@ -192,39 +192,39 @@ pub enum Commands { Validate(validate::ValidateArgs), } -pub fn execute(command: &Commands) { - match command { - Commands::About(args) => about::execute(args), - Commands::Archive(args) => archive::execute(args), - Commands::Audit(args) => audit::execute(args), - Commands::Browse(args) => browse::execute(args), - Commands::Bump(args) => bump::execute(args), - Commands::CheckPlatformReqs(args) => check_platform_reqs::execute(args), - Commands::ClearCache(args) => clear_cache::execute(args), - Commands::Config(args) => config::execute(args), - Commands::CreateProject(args) => create_project::execute(args), - Commands::Depends(args) => depends::execute(args), - Commands::Diagnose(args) => diagnose::execute(args), - Commands::DumpAutoload(args) => dump_autoload::execute(args), - Commands::Exec(args) => exec::execute(args), - Commands::Fund(args) => fund::execute(args), - Commands::Global(args) => global::execute(args), - Commands::Init(args) => init::execute(args), - Commands::Install(args) => install::execute(args), - Commands::Licenses(args) => licenses::execute(args), - Commands::Outdated(args) => outdated::execute(args), - Commands::Prohibits(args) => prohibits::execute(args), - Commands::Reinstall(args) => reinstall::execute(args), - Commands::Remove(args) => remove::execute(args), - Commands::Repository(args) => repository::execute(args), - Commands::Require(args) => require::execute(args), - Commands::RunScript(args) => run_script::execute(args), - Commands::Search(args) => search::execute(args), - Commands::SelfUpdate(args) => self_update::execute(args), - Commands::Show(args) => show::execute(args), - Commands::Status(args) => status::execute(args), - Commands::Suggests(args) => suggests::execute(args), - Commands::Update(args) => update::execute(args), - Commands::Validate(args) => validate::execute(args), +pub fn execute(cli: &Cli) -> anyhow::Result<()> { + match &cli.command { + Commands::About(args) => about::execute(args, cli), + Commands::Archive(args) => archive::execute(args, cli), + Commands::Audit(args) => audit::execute(args, cli), + Commands::Browse(args) => browse::execute(args, cli), + Commands::Bump(args) => bump::execute(args, cli), + Commands::CheckPlatformReqs(args) => check_platform_reqs::execute(args, cli), + Commands::ClearCache(args) => clear_cache::execute(args, cli), + Commands::Config(args) => config::execute(args, cli), + Commands::CreateProject(args) => create_project::execute(args, cli), + Commands::Depends(args) => depends::execute(args, cli), + Commands::Diagnose(args) => diagnose::execute(args, cli), + Commands::DumpAutoload(args) => dump_autoload::execute(args, cli), + Commands::Exec(args) => exec::execute(args, cli), + Commands::Fund(args) => fund::execute(args, cli), + Commands::Global(args) => global::execute(args, cli), + Commands::Init(args) => init::execute(args, cli), + Commands::Install(args) => install::execute(args, cli), + Commands::Licenses(args) => licenses::execute(args, cli), + Commands::Outdated(args) => outdated::execute(args, cli), + Commands::Prohibits(args) => prohibits::execute(args, cli), + Commands::Reinstall(args) => reinstall::execute(args, cli), + Commands::Remove(args) => remove::execute(args, cli), + Commands::Repository(args) => repository::execute(args, cli), + Commands::Require(args) => require::execute(args, cli), + Commands::RunScript(args) => run_script::execute(args, cli), + Commands::Search(args) => search::execute(args, cli), + Commands::SelfUpdate(args) => self_update::execute(args, cli), + Commands::Show(args) => show::execute(args, cli), + Commands::Status(args) => status::execute(args, cli), + Commands::Suggests(args) => suggests::execute(args, cli), + Commands::Update(args) => update::execute(args, cli), + Commands::Validate(args) => validate::execute(args, cli), } } diff --git a/crates/mozart/src/commands/about.rs b/crates/mozart/src/commands/about.rs index 833b6c8..bf3742d 100644 --- a/crates/mozart/src/commands/about.rs +++ b/crates/mozart/src/commands/about.rs @@ -3,6 +3,6 @@ use clap::Args; #[derive(Args)] pub struct AboutArgs {} -pub fn execute(_args: &AboutArgs) { +pub fn execute(_args: &AboutArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/archive.rs b/crates/mozart/src/commands/archive.rs index 1fbef6c..f5e6f60 100644 --- a/crates/mozart/src/commands/archive.rs +++ b/crates/mozart/src/commands/archive.rs @@ -25,6 +25,6 @@ pub struct ArchiveArgs { pub ignore_filters: bool, } -pub fn execute(_args: &ArchiveArgs) { +pub fn execute(_args: &ArchiveArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/audit.rs b/crates/mozart/src/commands/audit.rs index 02b0d8d..4aa048d 100644 --- a/crates/mozart/src/commands/audit.rs +++ b/crates/mozart/src/commands/audit.rs @@ -27,6 +27,6 @@ pub struct AuditArgs { pub ignore_unreachable: bool, } -pub fn execute(_args: &AuditArgs) { +pub fn execute(_args: &AuditArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/browse.rs b/crates/mozart/src/commands/browse.rs index b6cb08f..e3b9287 100644 --- a/crates/mozart/src/commands/browse.rs +++ b/crates/mozart/src/commands/browse.rs @@ -14,6 +14,6 @@ pub struct BrowseArgs { pub show: bool, } -pub fn execute(_args: &BrowseArgs) { +pub fn execute(_args: &BrowseArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/bump.rs b/crates/mozart/src/commands/bump.rs index 40e01f1..fbeba0e 100644 --- a/crates/mozart/src/commands/bump.rs +++ b/crates/mozart/src/commands/bump.rs @@ -18,6 +18,6 @@ pub struct BumpArgs { pub dry_run: bool, } -pub fn execute(_args: &BumpArgs) { +pub fn execute(_args: &BumpArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/check_platform_reqs.rs b/crates/mozart/src/commands/check_platform_reqs.rs index 697b3f6..d0e6122 100644 --- a/crates/mozart/src/commands/check_platform_reqs.rs +++ b/crates/mozart/src/commands/check_platform_reqs.rs @@ -15,6 +15,6 @@ pub struct CheckPlatformReqsArgs { pub format: Option<String>, } -pub fn execute(_args: &CheckPlatformReqsArgs) { +pub fn execute(_args: &CheckPlatformReqsArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/clear_cache.rs b/crates/mozart/src/commands/clear_cache.rs index 051ff4c..638de06 100644 --- a/crates/mozart/src/commands/clear_cache.rs +++ b/crates/mozart/src/commands/clear_cache.rs @@ -7,6 +7,6 @@ pub struct ClearCacheArgs { pub gc: bool, } -pub fn execute(_args: &ClearCacheArgs) { +pub fn execute(_args: &ClearCacheArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/config.rs b/crates/mozart/src/commands/config.rs index 4434840..8e05918 100644 --- a/crates/mozart/src/commands/config.rs +++ b/crates/mozart/src/commands/config.rs @@ -53,6 +53,6 @@ pub struct ConfigArgs { pub source: bool, } -pub fn execute(_args: &ConfigArgs) { +pub fn execute(_args: &ConfigArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/create_project.rs b/crates/mozart/src/commands/create_project.rs index 814d33b..e8339d0 100644 --- a/crates/mozart/src/commands/create_project.rs +++ b/crates/mozart/src/commands/create_project.rs @@ -100,6 +100,6 @@ pub struct CreateProjectArgs { pub ask: bool, } -pub fn execute(_args: &CreateProjectArgs) { +pub fn execute(_args: &CreateProjectArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/depends.rs b/crates/mozart/src/commands/depends.rs index 33aabc6..ecdbb24 100644 --- a/crates/mozart/src/commands/depends.rs +++ b/crates/mozart/src/commands/depends.rs @@ -18,6 +18,6 @@ pub struct DependsArgs { pub locked: bool, } -pub fn execute(_args: &DependsArgs) { +pub fn execute(_args: &DependsArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/diagnose.rs b/crates/mozart/src/commands/diagnose.rs index 5a77ba5..648e16d 100644 --- a/crates/mozart/src/commands/diagnose.rs +++ b/crates/mozart/src/commands/diagnose.rs @@ -3,6 +3,6 @@ use clap::Args; #[derive(Args)] pub struct DiagnoseArgs {} -pub fn execute(_args: &DiagnoseArgs) { +pub fn execute(_args: &DiagnoseArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/dump_autoload.rs b/crates/mozart/src/commands/dump_autoload.rs index 0eb20c9..cd932b0 100644 --- a/crates/mozart/src/commands/dump_autoload.rs +++ b/crates/mozart/src/commands/dump_autoload.rs @@ -47,6 +47,6 @@ pub struct DumpAutoloadArgs { pub strict_ambiguous: bool, } -pub fn execute(_args: &DumpAutoloadArgs) { +pub fn execute(_args: &DumpAutoloadArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/exec.rs b/crates/mozart/src/commands/exec.rs index 7635058..c95c1eb 100644 --- a/crates/mozart/src/commands/exec.rs +++ b/crates/mozart/src/commands/exec.rs @@ -14,6 +14,6 @@ pub struct ExecArgs { pub list: bool, } -pub fn execute(_args: &ExecArgs) { +pub fn execute(_args: &ExecArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/fund.rs b/crates/mozart/src/commands/fund.rs index bd82306..a672b18 100644 --- a/crates/mozart/src/commands/fund.rs +++ b/crates/mozart/src/commands/fund.rs @@ -7,6 +7,6 @@ pub struct FundArgs { pub format: Option<String>, } -pub fn execute(_args: &FundArgs) { +pub fn execute(_args: &FundArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/global.rs b/crates/mozart/src/commands/global.rs index c4de5e4..802e085 100644 --- a/crates/mozart/src/commands/global.rs +++ b/crates/mozart/src/commands/global.rs @@ -10,6 +10,6 @@ pub struct GlobalArgs { pub args: Vec<String>, } -pub fn execute(_args: &GlobalArgs) { +pub fn execute(_args: &GlobalArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/init.rs b/crates/mozart/src/commands/init.rs index 059e494..0f10186 100644 --- a/crates/mozart/src/commands/init.rs +++ b/crates/mozart/src/commands/init.rs @@ -47,6 +47,6 @@ pub struct InitArgs { pub autoload: Option<String>, } -pub fn execute(_args: &InitArgs) { +pub fn execute(_args: &InitArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/install.rs b/crates/mozart/src/commands/install.rs index e839e96..fbff8a4 100644 --- a/crates/mozart/src/commands/install.rs +++ b/crates/mozart/src/commands/install.rs @@ -86,6 +86,6 @@ pub struct InstallArgs { pub ignore_platform_reqs: bool, } -pub fn execute(_args: &InstallArgs) { +pub fn execute(_args: &InstallArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/licenses.rs b/crates/mozart/src/commands/licenses.rs index d9b0caf..726f3c8 100644 --- a/crates/mozart/src/commands/licenses.rs +++ b/crates/mozart/src/commands/licenses.rs @@ -15,6 +15,6 @@ pub struct LicensesArgs { pub locked: bool, } -pub fn execute(_args: &LicensesArgs) { +pub fn execute(_args: &LicensesArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/outdated.rs b/crates/mozart/src/commands/outdated.rs index 3bbb451..72a484f 100644 --- a/crates/mozart/src/commands/outdated.rs +++ b/crates/mozart/src/commands/outdated.rs @@ -62,6 +62,6 @@ pub struct OutdatedArgs { pub ignore_platform_reqs: bool, } -pub fn execute(_args: &OutdatedArgs) { +pub fn execute(_args: &OutdatedArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/prohibits.rs b/crates/mozart/src/commands/prohibits.rs index aff1ee0..8f87644 100644 --- a/crates/mozart/src/commands/prohibits.rs +++ b/crates/mozart/src/commands/prohibits.rs @@ -21,6 +21,6 @@ pub struct ProhibitsArgs { pub locked: bool, } -pub fn execute(_args: &ProhibitsArgs) { +pub fn execute(_args: &ProhibitsArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/reinstall.rs b/crates/mozart/src/commands/reinstall.rs index 08aad44..ef3d78d 100644 --- a/crates/mozart/src/commands/reinstall.rs +++ b/crates/mozart/src/commands/reinstall.rs @@ -54,6 +54,6 @@ pub struct ReinstallArgs { pub r#type: Vec<String>, } -pub fn execute(_args: &ReinstallArgs) { +pub fn execute(_args: &ReinstallArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/remove.rs b/crates/mozart/src/commands/remove.rs index b444a66..39832e8 100644 --- a/crates/mozart/src/commands/remove.rs +++ b/crates/mozart/src/commands/remove.rs @@ -90,6 +90,6 @@ pub struct RemoveArgs { pub apcu_autoloader_prefix: Option<String>, } -pub fn execute(_args: &RemoveArgs) { +pub fn execute(_args: &RemoveArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/repository.rs b/crates/mozart/src/commands/repository.rs index 8646c06..3a094cc 100644 --- a/crates/mozart/src/commands/repository.rs +++ b/crates/mozart/src/commands/repository.rs @@ -35,6 +35,6 @@ pub struct RepositoryArgs { pub after: Option<String>, } -pub fn execute(_args: &RepositoryArgs) { +pub fn execute(_args: &RepositoryArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/require.rs b/crates/mozart/src/commands/require.rs index 3b8cceb..923a77c 100644 --- a/crates/mozart/src/commands/require.rs +++ b/crates/mozart/src/commands/require.rs @@ -118,6 +118,6 @@ pub struct RequireArgs { pub apcu_autoloader_prefix: Option<String>, } -pub fn execute(_args: &RequireArgs) { +pub fn execute(_args: &RequireArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/run_script.rs b/crates/mozart/src/commands/run_script.rs index e2349a2..6adcc72 100644 --- a/crates/mozart/src/commands/run_script.rs +++ b/crates/mozart/src/commands/run_script.rs @@ -26,6 +26,6 @@ pub struct RunScriptArgs { pub list: bool, } -pub fn execute(_args: &RunScriptArgs) { +pub fn execute(_args: &RunScriptArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/search.rs b/crates/mozart/src/commands/search.rs index 3d2d20f..9396e6f 100644 --- a/crates/mozart/src/commands/search.rs +++ b/crates/mozart/src/commands/search.rs @@ -23,6 +23,6 @@ pub struct SearchArgs { pub format: Option<String>, } -pub fn execute(_args: &SearchArgs) { +pub fn execute(_args: &SearchArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/self_update.rs b/crates/mozart/src/commands/self_update.rs index 3497d7d..a1291db 100644 --- a/crates/mozart/src/commands/self_update.rs +++ b/crates/mozart/src/commands/self_update.rs @@ -50,6 +50,6 @@ pub struct SelfUpdateArgs { pub set_channel_only: bool, } -pub fn execute(_args: &SelfUpdateArgs) { +pub fn execute(_args: &SelfUpdateArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/show.rs b/crates/mozart/src/commands/show.rs index 290a8dd..a00af5d 100644 --- a/crates/mozart/src/commands/show.rs +++ b/crates/mozart/src/commands/show.rs @@ -97,6 +97,6 @@ pub struct ShowArgs { pub ignore_platform_reqs: bool, } -pub fn execute(_args: &ShowArgs) { +pub fn execute(_args: &ShowArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/status.rs b/crates/mozart/src/commands/status.rs index 424f404..2eed119 100644 --- a/crates/mozart/src/commands/status.rs +++ b/crates/mozart/src/commands/status.rs @@ -3,6 +3,6 @@ use clap::Args; #[derive(Args)] pub struct StatusArgs {} -pub fn execute(_args: &StatusArgs) { +pub fn execute(_args: &StatusArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/suggests.rs b/crates/mozart/src/commands/suggests.rs index 6a80501..7c5f40d 100644 --- a/crates/mozart/src/commands/suggests.rs +++ b/crates/mozart/src/commands/suggests.rs @@ -26,6 +26,6 @@ pub struct SuggestsArgs { pub no_dev: bool, } -pub fn execute(_args: &SuggestsArgs) { +pub fn execute(_args: &SuggestsArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/update.rs b/crates/mozart/src/commands/update.rs index 0f1257c..7cbfd74 100644 --- a/crates/mozart/src/commands/update.rs +++ b/crates/mozart/src/commands/update.rs @@ -126,6 +126,6 @@ pub struct UpdateArgs { pub bump_after_update: Option<Option<String>>, } -pub fn execute(_args: &UpdateArgs) { +pub fn execute(_args: &UpdateArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/commands/validate.rs b/crates/mozart/src/commands/validate.rs index b76d479..7e821c2 100644 --- a/crates/mozart/src/commands/validate.rs +++ b/crates/mozart/src/commands/validate.rs @@ -34,6 +34,6 @@ pub struct ValidateArgs { pub strict: bool, } -pub fn execute(_args: &ValidateArgs) { +pub fn execute(_args: &ValidateArgs, _cli: &super::Cli) -> anyhow::Result<()> { todo!() } diff --git a/crates/mozart/src/main.rs b/crates/mozart/src/main.rs index 289d047..cd85137 100644 --- a/crates/mozart/src/main.rs +++ b/crates/mozart/src/main.rs @@ -1,7 +1,7 @@ use clap::Parser; use mozart::commands; -fn main() { +fn main() -> anyhow::Result<()> { let cli = commands::Cli::parse(); - commands::execute(&cli.command); + commands::execute(&cli) } |
