mirror of
https://github.com/chmln/handlr.git
synced 2024-11-27 03:13:49 +01:00
Launch - use UserPath
This commit is contained in:
parent
b5468c1ec7
commit
44efa593f8
2 changed files with 4 additions and 4 deletions
|
@ -29,7 +29,7 @@ pub enum Cmd {
|
||||||
/// Launch the handler for specified extension/mime with optional arguments
|
/// Launch the handler for specified extension/mime with optional arguments
|
||||||
Launch {
|
Launch {
|
||||||
mime: MimeOrExtension,
|
mime: MimeOrExtension,
|
||||||
args: Vec<String>,
|
args: Vec<UserPath>,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// Get handler for this mime/extension
|
/// Get handler for this mime/extension
|
||||||
|
|
|
@ -12,8 +12,8 @@ mod utils;
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
use clap::Clap;
|
use clap::Clap;
|
||||||
use cli::Cmd;
|
use cli::Cmd;
|
||||||
use common::{Handler};
|
use common::Handler;
|
||||||
use std::{collections::HashMap};
|
use std::collections::HashMap;
|
||||||
|
|
||||||
// create config if it doesn't exist
|
// create config if it doesn't exist
|
||||||
Lazy::force(&CONFIG);
|
Lazy::force(&CONFIG);
|
||||||
|
@ -31,7 +31,7 @@ fn main() -> Result<()> {
|
||||||
apps.save()?;
|
apps.save()?;
|
||||||
}
|
}
|
||||||
Cmd::Launch { mime, args } => {
|
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 } => {
|
Cmd::Get { mime, json } => {
|
||||||
apps.show_handler(&mime.0, json)?;
|
apps.show_handler(&mime.0, json)?;
|
||||||
|
|
Loading…
Reference in a new issue