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: String,
#[arg(short, long)]
output: Option<PathBuf>,
#[arg(long)]
highway: Option<String>,
}
pub async fn run(args: Args) -> Result<()> {
let config = Config::load().unwrap_or_default();
config.init_logging();
tracing::info!("Extracting OSM data for bbox: {}", args.bbox);
tracing::warn!("OSM extraction not yet implemented");
Err(anyhow::anyhow!("OSM extraction not yet implemented"))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_extract_osm_args() {
let args = Args {
bbox: "-73.59,45.49,-73.55,45.52".to_string(),
output: None,
highway: Some("primary,secondary".to_string()),
};
assert_eq!(args.bbox, "-73.59,45.49,-73.55,45.52");
assert_eq!(args.highway, Some("primary,secondary".to_string()));
}
}