1
0
Fork 0
trinitrix/src/main.rs

60 lines
1.8 KiB
Rust
Raw Normal View History

/*
* Copyright (C) 2024 - 2024:
* The Trinitrix Project <benedikt.peetz@b-peetz.de, antifallobst@systemausfall.org, sils@sils.li>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* This file is part of Trinitrix.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/
mod app;
mod cli;
mod ui;
use anyhow::Context;
use clap::Parser;
2024-05-04 15:43:30 +00:00
use crate::{
cli::{Args, Command},
ui::repl::Repl,
};
2023-06-14 21:49:20 +00:00
#[tokio::main]
async fn main() -> anyhow::Result<()> {
2023-07-01 10:44:11 +00:00
cli_log::init_cli_log!();
let args = Args::parse();
let command = args.subcommand.unwrap_or(Command::Start {});
match command {
Command::Start {} => {
2024-05-04 15:43:30 +00:00
todo!("The full ui is not yet finished");
let mut app = app::App::new(Repl::new()?)?;
2024-05-04 15:43:30 +00:00
// NOTE(@soispha): The `None` here is temporary <2024-05-03>
app.run(None, args.plugin_path).await?;
}
Command::Repl {} => {
let mut app = app::App::new(Repl::new().context("Failed to setup repl")?)?;
2024-05-04 15:43:30 +00:00
// NOTE(@soispha): The `None` here is temporary <2024-05-03>
app.run(None, args.plugin_path).await?;
}
};
2023-06-14 21:49:20 +00:00
Ok(())
}
// FIXME(@soispha): Re-exports for trixy, this should be configurable <2024-05-03>
pub use crate::app::command_interface::*;