Launch - use UserPath

This commit is contained in:
Gregory 2021-04-25 12:44:29 -04:00
parent b5468c1ec7
commit 44efa593f8
No known key found for this signature in database
GPG key ID: 2E44FAEEDC94B1E2
2 changed files with 4 additions and 4 deletions

View file

@ -29,7 +29,7 @@ pub enum Cmd {
/// Launch the handler for specified extension/mime with optional arguments
Launch {
mime: MimeOrExtension,
args: Vec<String>,
args: Vec<UserPath>,
},
/// Get handler for this mime/extension

View file

@ -12,8 +12,8 @@ mod utils;
fn main() -> Result<()> {
use clap::Clap;
use cli::Cmd;
use common::{Handler};
use std::{collections::HashMap};
use common::Handler;
use std::collections::HashMap;
// create config if it doesn't exist
Lazy::force(&CONFIG);
@ -31,7 +31,7 @@ fn main() -> Result<()> {
apps.save()?;
}
Cmd::Launch { mime, args } => {
apps.get_handler(&mime.0)?.launch(args)?;
apps.get_handler(&mime.0)?.launch(args.into_iter().map(|a| a.to_string()).collect())?;
}
Cmd::Get { mime, json } => {
apps.show_handler(&mime.0, json)?;