#![warn(clippy::all)]
#![warn(clippy::pedantic)]
use std::process;
use clap::{Parser, Subcommand};
mod breakpoint;
mod controller;
mod debug_utils;
mod protocol;
mod sigint;
mod test_utils;
mod util;
#[derive(Debug, Parser)]
#[command(name = "breakmancer")]
#[command(about = "Drop a breakpoint into any shell.")]
#[command(version, arg_required_else_help = true)]
struct Cli {
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand, Debug)]
enum Commands {
#[command(name = "start")]
Controller(controller::Cli),
#[command(name = "break")]
Break(breakpoint::Cli),
}
#[tokio::main]
async fn main() {
let args = Cli::parse();
let outcome = match args.command {
Commands::Controller(args) => controller::run(&args).await,
Commands::Break(args) => breakpoint::run(&args).await,
};
if let Err(err) = outcome {
eprintln!("{err}");
process::exit(1)
}
}