Skip to content

Commit

Permalink
Add help messages and aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
arseeeeN committed Dec 10, 2024
1 parent 7d51f09 commit 49c7981
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,29 @@ pub struct Cli {

#[derive(Debug, Subcommand)]
pub enum MainCommands {
#[command()]
#[command(
arg_required_else_help = true,
about = "Start Tomcat inside this terminal"
)]
Run {
#[arg(long)]
#[arg(long, help = "Start in debug mode and open the JPDA endpoint")]
jpda: bool,
config: String,
},
#[command(arg_required_else_help = true)]
#[command(
arg_required_else_help = true,
about = "Start Tomcat in the built-in debugger"
)]
Debug { config: String },
#[command(arg_required_else_help = true)]
#[command(
arg_required_else_help = true,
about = "Deploy the specified config without starting Tomcat"
)]
Deploy { config: String },
#[command(arg_required_else_help = true)]
#[command(
arg_required_else_help = true,
about = "Manage your tomcatctl deployment configs"
)]
Config {
#[command(subcommand)]
command: ConfigCommands,
Expand All @@ -31,15 +43,18 @@ pub enum MainCommands {

#[derive(Debug, Subcommand)]
pub enum ConfigCommands {
#[command(arg_required_else_help = true)]
#[command(arg_required_else_help = true, about = "Add a deployment config")]
Add {
name: String,
path: String,
project_path: String,
},
#[command(arg_required_else_help = true)]
Remove {
name: String,
},
#[command(
arg_required_else_help = true,
about = "Remove a deployment config",
alias = "rm"
)]
Remove { name: String },
#[command(about = "List all valid deployment configs", alias = "ls")]
List,
}

0 comments on commit 49c7981

Please sign in to comment.