Skip to main content

run_from

Function run_from 

Source
pub fn run_from(arguments: impl IntoIterator<Item = OsString>) -> ExitCode
Expand description

run with explicit arguments (everything after the program name).

A host that has no separate helper executable can re-launch its own binary with a private first argument and hand the remaining arguments to the helper, so the helper still runs in a process of its own:

fn main() -> std::process::ExitCode {
    let mut args = std::env::args_os().skip(1);
    if args.next().is_some_and(|first| first == "--originlm-helper") {
        return originlm_cli::run_from(args);
    }
    // ... the host application ...
    std::process::ExitCode::SUCCESS
}