yazi/yazi-actor/src/tasks/open_with.rs
2025-10-01 20:03:41 +08:00

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(),
));
}
}