pondrs 0.3.0

A pipeline execution library
Documentation
//! CLI argument definitions using clap.

use std::prelude::v1::*;

use clap::{Parser, Subcommand};

/// Top-level CLI arguments parsed by clap.
#[derive(Parser)]
#[command(version, about)]
pub struct CliArgs {
    #[command(subcommand)]
    pub command: Command,

    /// Path to catalog YAML config file.
    #[arg(long, global = true)]
    pub catalog_path: Option<String>,

    /// Path to parameters YAML config file.
    #[arg(long, global = true)]
    pub params_path: Option<String>,
}

#[derive(Subcommand)]
pub enum Command {
    /// Execute the pipeline.
    Run {
        /// Runner to use (by name).
        #[arg(long)]
        runner: Option<String>,

        /// Override parameter values (dot notation for nesting, e.g. model.learning_rate=0.01).
        #[arg(long = "params", value_name = "KEY=VALUE")]
        param_overrides: Vec<String>,

        /// Override catalog values (dot notation for nesting, e.g. output.path=/tmp/out.csv).
        #[arg(long = "catalog", value_name = "KEY=VALUE")]
        catalog_overrides: Vec<String>,

        /// Run only the named nodes (comma-separated).
        #[arg(long, value_delimiter = ',', conflicts_with_all = ["from_nodes", "to_nodes"])]
        nodes: Vec<String>,

        /// Run from these nodes onwards (comma-separated).
        #[arg(long, value_delimiter = ',', conflicts_with = "nodes")]
        from_nodes: Vec<String>,

        /// Run up to and including these nodes (comma-separated).
        #[arg(long, value_delimiter = ',', conflicts_with = "nodes")]
        to_nodes: Vec<String>,
    },

    /// Validate pipeline structure (dependency ordering, output uniqueness).
    Check,

    /// Build pipeline graph and serve visualization.
    Viz {
        /// Port for the visualization server.
        #[arg(long, default_value = "8080")]
        port: u16,

        /// Write pipeline graph JSON to file instead of serving.
        #[arg(long)]
        output: Option<String>,

        /// Export a self-contained HTML file with the pipeline graph.
        #[arg(long)]
        export: Option<String>,
    },
}