Skip to main content

run_with_plan

Function run_with_plan 

Source
pub fn run_with_plan(
    plan: &OutputPlan,
    execute: impl FnOnce(&mut ProcessEmitter) -> Result<u8, CliStop>,
) -> ExitCode
Expand description

The output half of CliMain, for a program that arrived at its OutputPlan some other way — a translated foreign grammar, say.

Installs the plan’s file sinks, builds the emitter the plan asks for, runs execute, and settles its exit code against what the emitter wrote. A CliStop from execute is emitted through that emitter.