jevsnes.git / apps / native / src / main.rs
1//! Entry point only: dispatch between the stdio MCP proxy and the window.
2//!
3//! Deliberately tiny (2026-09-20 split) - the window itself, `App` and its
4//! patch points live in `app.rs`, ITS OWN `rust_library` target, so that
5//! `tools/hotpatch/patch.sh` never has to relink this executable to pick up
6//! an edit there or in `packages/panels`. See `app.rs`'s doc comment and
7//! `../CLAUDE.md`.
8
9use std::env;
10use std::process::ExitCode;
11
12fn main() -> ExitCode {
13    if env::args().nth(1).as_deref() == Some("mcp") {
14        return mcp::proxy::run();
15    }
16    match app::window() {
17        Ok(()) => ExitCode::SUCCESS,
18        Err(e) => {
19            eprintln!("{e}");
20            ExitCode::FAILURE
21        }
22    }
23}