1
0
Fork 0

fix(ui): default to help message

This commit is contained in:
Silas Schöffel 2024-05-08 20:14:15 +02:00
parent 580b443dcc
commit d756afbc06
Signed by: sils
GPG Key ID: 6A587D46E3F44592
2 changed files with 6 additions and 13 deletions

View File

@ -25,11 +25,11 @@ use clap::{Parser, Subcommand};
/// A multi protocol chat client
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
#[command(author, version, about, long_about = None, arg_required_else_help(true))]
pub struct Args {
#[command(subcommand)]
/// The subcommand to execute, default is start
pub subcommand: Option<Command>,
/// The subcommand to execute, default is help
pub subcommand: Command,
// #[arg(long, short)]
// /// Path to the Lua config file, executed instead of the normal one
@ -41,7 +41,7 @@ pub struct Args {
#[derive(Subcommand, Debug)]
pub enum Command {
/// Starts the main TUI client
Start {},
Tui {},
/// Starts a repl to the trinitry cli interpreter
Repl {},

View File

@ -36,15 +36,8 @@ async fn main() -> anyhow::Result<()> {
cli_log::init_cli_log!();
let args = Args::parse();
let command = args.subcommand.unwrap_or(Command::Start {});
match command {
Command::Start {} => {
todo!("The full ui is not yet finished");
let mut app = app::App::new(Repl::new()?)?;
// NOTE(@soispha): The `None` here is temporary <2024-05-03>
app.run(None, args.plugin_path).await?;
}
match args.subcommand {
Command::Tui {} => {}
Command::Repl {} => {
let mut app = app::App::new(Repl::new().context("Failed to setup repl")?)?;