use clap::Subcommand;
use std::path::PathBuf;
#[derive(Subcommand)]
pub enum Commands {
Start {
program: PathBuf,
#[arg(last = true)]
args: Vec<String>,
#[arg(long)]
adapter: Option<String>,
#[arg(long)]
stop_on_entry: bool,
#[arg(long = "break", short = 'b')]
initial_breakpoints: Vec<String>,
},
Attach {
pid: u32,
#[arg(long)]
adapter: Option<String>,
},
#[command(subcommand)]
Breakpoint(BreakpointCommands),
#[command(name = "break", alias = "b")]
Break {
location: String,
#[arg(long, short)]
condition: Option<String>,
},
#[command(alias = "c")]
Continue,
#[command(alias = "n")]
Next,
#[command(alias = "s")]
Step,
#[command(alias = "out")]
Finish,
Pause,
#[command(alias = "bt")]
Backtrace {
#[arg(long, default_value = "20")]
limit: usize,
#[arg(long)]
locals: bool,
},
Locals,
#[command(alias = "p")]
Print {
expression: String,
},
Eval {
expression: String,
},
#[command(alias = "where")]
Context {
#[arg(long, default_value = "5")]
lines: usize,
},
Threads,
Thread {
id: Option<i64>,
},
Frame {
number: Option<usize>,
},
Up,
Down,
Await {
#[arg(long, default_value = "300")]
timeout: u64,
},
Output {
#[arg(long)]
follow: bool,
#[arg(long)]
tail: Option<usize>,
#[arg(long)]
clear: bool,
},
Status,
Stop,
Detach,
Restart,
Logs {
#[arg(long, short = 'n', default_value = "50")]
lines: usize,
#[arg(long, short)]
follow: bool,
#[arg(long)]
clear: bool,
},
#[command(hide = true)]
Daemon,
Setup {
debugger: Option<String>,
#[arg(long)]
version: Option<String>,
#[arg(long)]
list: bool,
#[arg(long)]
check: bool,
#[arg(long, name = "auto")]
auto_detect: bool,
#[arg(long)]
uninstall: bool,
#[arg(long)]
path: bool,
#[arg(long)]
force: bool,
#[arg(long)]
dry_run: bool,
#[arg(long)]
json: bool,
},
Test {
path: PathBuf,
#[arg(long, short)]
verbose: bool,
},
}
#[derive(Subcommand)]
pub enum BreakpointCommands {
Add {
location: String,
#[arg(long, short)]
condition: Option<String>,
#[arg(long)]
hit_count: Option<u32>,
},
Remove {
id: Option<u32>,
#[arg(long)]
all: bool,
},
List,
Enable {
id: u32,
},
Disable {
id: u32,
},
}