use obiread::path_iter;
use std::env;
use tracing::info;
use tracing_subscriber::{EnvFilter, fmt};

fn main() {
    // Build a subscriber with environment-based filtering
    fmt().with_env_filter(EnvFilter::from_default_env()).init();

    info!("Expanding paths...");
    let args: Vec<String> = env::args().skip(1).collect();

    if args.is_empty() {
        eprintln!("Usage: cargo run -p obiread --example expand_path -- <path> [path...]");
        std::process::exit(1);
    }

    let files = path_iter(&args);
    for f in files {
        println!("{}", f.display());
    }
}
