mod cli;
mod commands;
mod config;
mod error;

use anyhow::Result;
use clap::Parser;
use cli::{Cli, Commands};

fn main() -> Result<()> {
    let cli = Cli::parse();

    // Load configuration based on CLI arguments
    let config = config::load(cli.verbose)?;

    if config.verbose {
        println!("Running in verbose mode");
    }

    // Execute command based on subcommand
    match &cli.command {
        Some(Commands::Example { input }) => {
            commands::execute_example(input.clone())?;
        }
        None => {
            println!("No command specified. Use --help for usage information.");
        }
    }

    Ok(())
}
