pub mod ca;
pub mod logs;
pub mod pid;
pub mod start;
pub mod status;
pub mod stop;
use std::process::ExitCode;
use clap::{Args, Subcommand};
#[derive(Debug, Subcommand)]
pub enum ProxyCommands {
Start(start::StartArgs),
Stop,
Status(status::StatusArgs),
InstallCa(ca::CaArgs),
UninstallCa(ca::CaArgs),
Logs(logs::LogsArgs),
}
#[derive(Debug, Args)]
pub struct ProxyArgs {
#[command(subcommand)]
pub command: ProxyCommands,
}
pub fn dispatch(args: ProxyArgs) -> ExitCode {
match args.command {
ProxyCommands::Start(a) => start::dispatch(a),
ProxyCommands::Stop => stop::dispatch(),
ProxyCommands::Status(a) => status::dispatch(a),
ProxyCommands::InstallCa(a) => ca::install(a),
ProxyCommands::UninstallCa(a) => ca::uninstall(a),
ProxyCommands::Logs(a) => logs::dispatch(a),
}
}