mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
22 lines
445 B
Rust
22 lines
445 B
Rust
use anyhow::Result;
|
|
use yazi_macro::succ;
|
|
use yazi_parser::mgr::OpenWithOpt;
|
|
use yazi_shared::data::Data;
|
|
|
|
use crate::{Actor, Ctx};
|
|
|
|
pub struct OpenWith;
|
|
|
|
impl Actor for OpenWith {
|
|
type Options = OpenWithOpt;
|
|
|
|
const NAME: &str = "open_with";
|
|
|
|
fn act(cx: &mut Ctx, opt: Self::Options) -> Result<Data> {
|
|
succ!(cx.tasks.process_from_opener(
|
|
opt.cwd,
|
|
opt.opener,
|
|
opt.targets.into_iter().map(|u| u.into_os_str2()).collect(),
|
|
));
|
|
}
|
|
}
|