use crate::config::Config;
use anyhow::Result;
use clap::Args as ClapArgs;
use std::path::PathBuf;
#[derive(Debug, ClapArgs)]
pub struct Args {
#[arg(long)]
bbox: Option<String>,
#[arg(long)]
polygon: Option<PathBuf>,
#[arg(long, default_value = "overture")]
source: String,
#[arg(long)]
input: Option<PathBuf>,
#[arg(short, long)]
output: Option<PathBuf>,
#[arg(long)]
gpx: bool,
#[arg(long)]
no_clean: bool,
#[arg(long)]
turn_left: Option<f64>,
#[arg(long)]
turn_right: Option<f64>,
#[arg(long)]
turn_u: Option<f64>,
#[arg(long)]
depot: Option<String>,
}
pub async fn run(_args: Args) -> Result<()> {
let config = Config::load().unwrap_or_default();
config.init_logging();
tracing::info!("Starting pipeline");
tracing::warn!("Pipeline not yet implemented");
Err(anyhow::anyhow!("Pipeline not yet implemented"))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_pipeline_args() {
let args = Args {
bbox: Some("-73.59,45.49,-73.55,45.52".to_string()),
polygon: None,
source: "overture".to_string(),
input: None,
output: None,
gpx: false,
no_clean: false,
turn_left: Some(1.0),
turn_right: None,
turn_u: None,
depot: None,
};
assert_eq!(args.source, "overture");
assert_eq!(args.turn_left, Some(1.0));
assert!(!args.no_clean);
}
}