feat: fix exec runner issue
This commit is contained in:
@@ -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.")]
|
||||
|
||||
@@ -29,7 +29,10 @@ type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
// region: Utilities Functions
|
||||
|
||||
fn stringified_exts_to_indices(program: &wfassoc::Program, exts: Vec<String>) -> Result<Vec<usize>> {
|
||||
fn stringified_exts_to_indices(
|
||||
program: &wfassoc::Program,
|
||||
exts: Vec<String>,
|
||||
) -> Result<Vec<usize>> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
@@ -45,8 +48,8 @@ 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.");
|
||||
@@ -55,7 +58,11 @@ fn run_status(program: wfassoc::Program, view: wfassoc::View) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn run_ext_link(program: wfassoc::Program, scope: wfassoc::Scope, exts: Vec<String>) -> Result<()> {
|
||||
fn run_ext_link(
|
||||
mut program: wfassoc::Program,
|
||||
scope: wfassoc::Scope,
|
||||
exts: Vec<String>,
|
||||
) -> 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<Stri
|
||||
}
|
||||
|
||||
fn run_ext_unlink(
|
||||
program: wfassoc::Program,
|
||||
mut program: wfassoc::Program,
|
||||
scope: wfassoc::Scope,
|
||||
exts: Vec<String>,
|
||||
) -> Result<()> {
|
||||
|
||||
@@ -601,7 +601,7 @@ impl Program {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ext_status(
|
||||
pub fn query_ext(
|
||||
&self,
|
||||
view: View,
|
||||
index: usize,
|
||||
|
||||
Reference in New Issue
Block a user