Skip to content
#![warn(clippy::pedantic)]

mod app;
mod cli;
mod client;
mod protocol;
mod service;
mod storage;
mod task;
mod timer;

fn main() {
    let args: Vec<String> = std::env::args().skip(1).collect();

    if args.is_empty() {
        launch_gui();
    } else {
        cli::run(&args);
    }
}

fn launch_gui() {
    let options = eframe::NativeOptions {
        viewport: eframe::egui::ViewportBuilder::default()
            .with_inner_size([600.0, 500.0])
            .with_min_inner_size([400.0, 350.0]),
        ..Default::default()
    };

    eframe::run_native(
        "Hyperfocus",
        options,
        Box::new(|cc| Ok(Box::new(app::HyperfocusApp::new(cc)))),
    )
    .expect("failed to launch GUI");
}