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 /// A multi protocol chat client
#[derive(Parser, Debug)] #[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 { pub struct Args {
#[command(subcommand)] #[command(subcommand)]
/// The subcommand to execute, default is start /// The subcommand to execute, default is help
pub subcommand: Option<Command>, pub subcommand: Command,
// #[arg(long, short)] // #[arg(long, short)]
// /// Path to the Lua config file, executed instead of the normal one // /// Path to the Lua config file, executed instead of the normal one
@ -41,7 +41,7 @@ pub struct Args {
#[derive(Subcommand, Debug)] #[derive(Subcommand, Debug)]
pub enum Command { pub enum Command {
/// Starts the main TUI client /// Starts the main TUI client
Start {}, Tui {},
/// Starts a repl to the trinitry cli interpreter /// Starts a repl to the trinitry cli interpreter
Repl {}, Repl {},

View File

@ -36,15 +36,8 @@ async fn main() -> anyhow::Result<()> {
cli_log::init_cli_log!(); cli_log::init_cli_log!();
let args = Args::parse(); let args = Args::parse();
let command = args.subcommand.unwrap_or(Command::Start {}); match args.subcommand {
match command { Command::Tui {} => {}
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?;
}
Command::Repl {} => { Command::Repl {} => {
let mut app = app::App::new(Repl::new().context("Failed to setup repl")?)?; let mut app = app::App::new(Repl::new().context("Failed to setup repl")?)?;