use clap::{Parser, Subcommand}; pub mod serve; pub mod backup; pub mod restore; pub mod migrate; pub mod stats; pub mod validate; pub mod create_admin; pub mod doctor; #[derive(Parser)] #[command(name = "bzod")] #[command(about = "BZOD - Personal Redirector & Landing Page Platform")] pub struct Cli { #[command(subcommand)] pub command: Commands, } #[derive(Subcommand)] pub enum Commands { /// Start the BZOD web server Serve { #[arg(long)] host: Option, #[arg(long)] port: Option, #[arg(long)] data_dir: Option, }, /// Create a tar.gz backup of all databases Backup { #[arg(long)] out: Option, #[arg(long)] data_dir: Option, }, /// Restore databases from a tar.gz backup file Restore { #[arg(long, required = true)] file: String, #[arg(long)] data_dir: Option, }, /// Apply pending database schema migrations Migrate { #[arg(long)] data_dir: Option, /// Show what migrations would be applied without executing them #[arg(long)] dry_run: bool, }, /// Print database statistics and record counts in the terminal Stats { #[arg(long)] data_dir: Option, }, /// Perform a one-shot validation of all registered short link destinations Validate { #[arg(long)] data_dir: Option, }, /// Create a new administrator user in the database CreateAdmin { #[arg(long)] username: Option, #[arg(long)] data_dir: Option, }, /// Run database diagnostics and health checks Doctor { #[arg(long)] data_dir: Option, }, }