use crate::config::Config;
use anyhow::Result;
use clap::Args as ClapArgs;
use std::path::PathBuf;
#[derive(Debug, ClapArgs)]
pub struct Args {
input: PathBuf,
#[arg(short, long)]
output: Option<PathBuf>,
#[arg(long, default_value = "1.0")]
min_length: f64,
#[arg(long)]
stats: bool,
}
pub fn run(args: &Args) -> Result<()> {
let config = Config::load().unwrap_or_default();
config.init_logging();
tracing::info!("Cleaning GeoJSON: {}", args.input.display());
tracing::warn!("GeoJSON cleaning not yet implemented");
Err(anyhow::anyhow!("GeoJSON cleaning not yet implemented"))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_clean_args() {
let args = Args {
input: PathBuf::from("test.geojson"),
output: None,
min_length: 2.0,
stats: true,
};
assert_eq!(args.input, PathBuf::from("test.geojson"));
assert_eq!(args.min_length, 2.0);
assert!(args.stats);
}
}