// SPDX-License-Identifier: GPL-3.0-or-later // src/main.rs // // Application entry point. mod ui; mod application; mod domain; mod infrastructure; mod config; mod i18n; use anyhow::Result; use clap::Parser; use cosmic::app::Settings; use crate::ui::NoctuaApp; #[derive(Parser, Debug, Clone)] #[command(version, about)] pub struct Args { /// File to open on startup #[arg(value_name = "FILE")] pub file: Option, /// UI language (e.g. "en", "de") #[arg(short, long, default_value = "en")] pub language: String, } fn main() -> Result<()> { // Get the system's preferred languages. let requested_languages = i18n_embed::DesktopLanguageRequester::requested_languages(); // Enable localizations to be applied. i18n::init(&requested_languages); env_logger::init(); let args = Args::parse(); cosmic::app::run::(Settings::default(), ui::app::Flags::Args(args)) .map_err(|e| anyhow::anyhow!(e)) }