-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmod.rs
More file actions
30 lines (25 loc) · 783 Bytes
/
mod.rs
File metadata and controls
30 lines (25 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use clap::Subcommand;
use crate::commands::base::Runnable;
pub mod add;
pub mod list;
pub mod preview;
// Global constants - these can stay in the main module file
const GITHUB_RAW_BASE: &str = "https://raw.githubusercontent.com/Byte-Barn/gitcraft/main/templates";
#[derive(Subcommand)]
pub enum Command {
/// Add one or more Issue templates to the repository
Add(add::AddArgs),
/// List available Issue templates
List(list::ListArgs),
/// Preview a specific Issue template
Preview(preview::PreviewArgs),
}
impl Command {
pub fn execute(&self) -> anyhow::Result<()> {
match self {
Command::Add(args) => args.run(),
Command::List(args) => args.run(),
Command::Preview(args) => args.run(),
}
}
}