//! Top-level subcommand dispatch.

use clap::Subcommand;
use miette::Report;
use std::process::ExitCode;

pub mod test;

use self::test::TestCmd;

#[derive(Debug, Subcommand)]
pub enum Command {
    /// Conformance and diagnostic checks against atproto services.
    #[command(subcommand)]
    Test(TestCmd),
}

impl Command {
    pub async fn run(self, no_color: bool) -> Result<ExitCode, Report> {
        match self {
            Command::Test(cmd) => cmd.run(no_color).await,
        }
    }
}
