fix(ui): default to help message
This commit is contained in:
parent
459661f03e
commit
27f1709d0e
|
@ -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<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
|
||||
|
@ -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 {},
|
||||
|
|
11
src/main.rs
11
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")?)?;
|
||||
|
||||
|
|
Reference in New Issue