use clap::{ArgMatches, Command};
use crate::infra::driving::cli::Context;
mod body;
mod check;
mod created;
mod distribution;
mod link;
mod list;
mod metrics;
mod new;
mod show;
mod stats;
mod status;
mod tag;
mod title;
mod tree;
pub(in super::super) fn issue_subcommand() -> Command {
Command::new("issue")
.about("Manage issues")
.subcommand_required(true)
.arg_required_else_help(true)
.subcommand(list::subcommand())
.subcommand(tree::subcommand())
.subcommand(show::subcommand())
.subcommand(check::subcommand())
.subcommand(new::subcommand())
.subcommand(link::subcommand())
.subcommand(metrics::subcommand())
.subcommand(body::subcommand())
.subcommand(created::subcommand())
.subcommand(status::subcommand())
.subcommand(tag::subcommand())
.subcommand(title::subcommand())
}
pub(in super::super) fn execute_issue(matches: &ArgMatches, ctx: &Context<'_>) {
match matches.subcommand() {
Some(("list", sub)) => list::execute(sub, ctx),
Some(("tree", sub)) => tree::execute(sub, ctx),
Some(("show", sub)) => show::execute(sub, ctx),
Some(("check", sub)) => check::execute(sub, ctx),
Some(("new", sub)) => new::execute(sub, ctx),
Some(("link", sub)) => link::execute(sub, ctx),
Some(("metrics", sub)) => metrics::execute(sub, ctx),
Some(("body", sub)) => body::execute(sub, ctx),
Some(("created", sub)) => created::execute(sub, ctx),
Some(("status", sub)) => status::execute(sub, ctx),
Some(("tag", sub)) => tag::execute(sub, ctx),
Some(("title", sub)) => title::execute(sub, ctx),
_ => unreachable!(),
}
}