From d4b52efee02c9a75931c53262a6a2184aec45ab0 Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Fri, 8 May 2026 14:14:55 +0800 Subject: [PATCH] feat: fix exec runner issue --- wfassoc-exec/src/cli.rs | 4 ++-- wfassoc-exec/src/runner.rs | 19 +++++++++++++------ wfassoc/src/highlevel.rs | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/wfassoc-exec/src/cli.rs b/wfassoc-exec/src/cli.rs index d260bc8..1320269 100644 --- a/wfassoc-exec/src/cli.rs +++ b/wfassoc-exec/src/cli.rs @@ -83,8 +83,8 @@ pub enum CliCommands { #[command(about = "Fetch the status of registration with given manifest and scope.")] Status { /// The view where fetch info. - #[arg(short = 't', long = "target", value_name = "TARGET", required = true, value_enum, default_value_t = RegView::User)] - target: RegView, + #[arg(short = 't', long = "target", value_name = "TARGET", required = true, value_enum, default_value_t = RegScope::User)] + target: RegScope, }, #[command(name = "ext")] #[command(about = "File extension related operations according to given program manifest.")] diff --git a/wfassoc-exec/src/runner.rs b/wfassoc-exec/src/runner.rs index 2749446..3af0322 100644 --- a/wfassoc-exec/src/runner.rs +++ b/wfassoc-exec/src/runner.rs @@ -29,7 +29,10 @@ type Result = std::result::Result; // region: Utilities Functions -fn stringified_exts_to_indices(program: &wfassoc::Program, exts: Vec) -> Result> { +fn stringified_exts_to_indices( + program: &wfassoc::Program, + exts: Vec, +) -> Result> { todo!() } @@ -45,17 +48,21 @@ fn run_unregister(mut program: wfassoc::Program, scope: wfassoc::Scope) -> Resul Ok(program.unregister(scope)?) } -fn run_status(program: wfassoc::Program, view: wfassoc::View) -> Result<()> { - if program.is_registered(view)? { +fn run_status(program: wfassoc::Program, scope: wfassoc::Scope) -> Result<()> { + if program.is_registered(scope)? { println!("Application is installed."); } else { println!("Application is not installed."); } - + Ok(()) } -fn run_ext_link(program: wfassoc::Program, scope: wfassoc::Scope, exts: Vec) -> Result<()> { +fn run_ext_link( + mut program: wfassoc::Program, + scope: wfassoc::Scope, + exts: Vec, +) -> Result<()> { let exts = stringified_exts_to_indices(&program, exts)?; for index in exts { program.link_ext(scope, index)?; @@ -64,7 +71,7 @@ fn run_ext_link(program: wfassoc::Program, scope: wfassoc::Scope, exts: Vec, ) -> Result<()> { diff --git a/wfassoc/src/highlevel.rs b/wfassoc/src/highlevel.rs index c6f1d3c..6e5d4dd 100644 --- a/wfassoc/src/highlevel.rs +++ b/wfassoc/src/highlevel.rs @@ -601,7 +601,7 @@ impl Program { } } - pub fn ext_status( + pub fn query_ext( &self, view: View, index: usize,