diff --git a/src/cli.rs b/src/cli.rs index af94f33..77eb4e4 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -24,11 +24,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, + /// 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 @@ -40,7 +40,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 {}, diff --git a/src/main.rs b/src/main.rs index dc30f53..1c16951 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,15 +35,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")?)?;