noctua/src/main.rs

44 lines
988 B
Rust
Raw Normal View History

2026-01-07 20:42:28 +01:00
// SPDX-License-Identifier: GPL-3.0-or-later
2026-01-07 20:22:49 +01:00
// src/main.rs
//
// Application entry point.
2026-01-07 20:22:49 +01:00
mod ui;
mod application;
mod domain;
mod infrastructure;
2026-01-07 20:22:49 +01:00
mod config;
mod i18n;
use anyhow::Result;
use clap::Parser;
use cosmic::app::Settings;
use crate::ui::NoctuaApp;
2026-01-07 20:22:49 +01:00
#[derive(Parser, Debug, Clone)]
#[command(version, about)]
pub struct Args {
/// File to open on startup
#[arg(value_name = "FILE")]
pub file: Option<std::path::PathBuf>,
/// 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::<NoctuaApp>(Settings::default(), ui::app::Flags::Args(args))
2026-01-07 20:22:49 +01:00
.map_err(|e| anyhow::anyhow!(e))
}