1use super::commands::*;
2use crate::shared::prelude::FoundConfig;
3use anyhow::Result;
4use clap::{Args, Subcommand};
5
6#[derive(Debug, Args)]
7pub struct DoctorArgs {
8 #[clap(subcommand)]
9 command: DoctorCommands,
10}
11
12#[derive(Debug, Subcommand)]
13enum DoctorCommands {
14 Run(DoctorRunArgs),
16 List(DoctorListArgs),
18 #[command(hide(true))]
20 Init(DoctorInitArgs),
21}
22
23pub async fn doctor_root(found_config: &FoundConfig, args: &DoctorArgs) -> Result<i32> {
24 match &args.command {
25 DoctorCommands::List(args) => doctor_list(found_config, args).await.map(|_| 0),
26 DoctorCommands::Run(args) => doctor_run(found_config, args).await,
27 DoctorCommands::Init(args) => doctor_init(found_config, args).await.map(|_| 0),
28 }
29}