use anyhow::Result;
use clap::Subcommand;
use crate::commands::{gitignore, issue, license, pr};
#[derive(Subcommand)]
pub enum Command {
Gitignore(gitignore::add::AddArgs),
#[command(name = "issue-template", alias = "issue")]
IssueTemplate(issue::add::AddArgs),
#[command(name = "pr-template", alias = "pr")]
PrTemplate(pr::add::AddArgs),
License(license::add::AddArgs),
}
impl Command {
pub fn execute(&self) -> Result<()> {
match self {
Self::Gitignore(args) => gitignore::Command::Add((*args).clone()).execute(),
Self::IssueTemplate(args) => issue::Command::Add((*args).clone()).execute(),
Self::PrTemplate(args) => pr::Command::Add((*args).clone()).execute(),
Self::License(args) => license::Command::Add((*args).clone()).execute(),
}
}
}