xvc_pipeline/pipeline/api/
run.rs

1use crate::error::Result;
2
3use clap::Parser;
4use xvc_core::XvcRoot;
5use xvc_core::XvcOutputSender;
6
7use crate::pipeline::the_grand_pipeline_loop;
8
9/// Run a pipeline
10#[derive(Debug, Clone, Parser)]
11#[command(name = "run")]
12pub struct RunCLI {}
13
14/// Entry point for `xvc pipeline run` command.
15///
16/// It loads an [`XvcPipeline`] with the name and runs [`the_grand_pipeline_loop`]
17/// with it.
18pub fn cmd_run(
19    output_snd: &XvcOutputSender,
20    xvc_root: &XvcRoot,
21    pipeline_name: &str,
22    _opts: RunCLI,
23) -> Result<()> {
24    let pipeline_name = pipeline_name.to_owned();
25    the_grand_pipeline_loop(output_snd, xvc_root, pipeline_name)
26}