use anyhow::Result;
use clap::Parser;

#[derive(Parser)]
#[command(name = "gui")]
#[command(version, about = "FCB1010 Looper Pedal GUI")]
pub struct Args {
    /// Launch in full screen mode
    #[arg(short = 'f', long = "full-screen")]
    pub full_screen: bool,
}

impl Args {
    pub fn new() -> Result<Self> {
        let res = Self::try_parse();
        if let Err(res) = &res {
            log::error!("{res}");
        }
        res.map_err(|_| anyhow::anyhow!("Failed to parse arguments"))
    }
}