use anyhow::Result;
use clap::{Args, Subcommand};
use super::{CheckCommand, ImportCommand, InstallCommand};
#[derive(Args)]
pub struct SetupCommand {
#[command(subcommand)]
action: SetupAction,
}
#[derive(Subcommand)]
enum SetupAction {
Import(ImportCommand),
Install(InstallCommand),
Check(CheckCommand),
}
impl SetupCommand {
pub fn execute(self, config: Option<String>, root: Option<String>) -> Result<bool> {
match self.action {
SetupAction::Import(command) => command.execute(config, root).map(|()| false),
SetupAction::Install(command) => command.execute(config, root).map(|()| false),
SetupAction::Check(command) => command.execute(config, root),
}
}
}