//! Clipkeep — low-memory macOS clipboard manager (GPUI + gpui-component).

mod actions;
mod app;
mod clipboard;
mod host;
mod macos;
mod store;
mod tray;
mod ui;

use tracing_subscriber::EnvFilter;

fn main() {
    tracing_subscriber::fmt()
        .with_env_filter(
            EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("clipkeep=info")),
        )
        .with_target(false)
        .init();

    let popup = std::env::args().any(|a| a == "--popup");
    let result = if popup { app::run() } else { host::run() };
    if let Err(err) = result {
        tracing::error!(%err, "clipkeep failed");
        std::process::exit(1);
    }
}