1use anyhow::Result;
6use clap::Parser;
7
8pub mod ci_patcher;
9pub mod commands;
10pub mod help_parser;
11pub mod orb_config;
12pub mod orb_generator;
13pub mod output_writer;
14
15#[derive(Debug, Parser)]
17#[command(author, version, about, long_about = None)]
18pub struct Cli {
19 #[command(subcommand)]
20 pub command: Commands,
21}
22
23#[derive(Debug, clap::Subcommand)]
25pub enum Commands {
26 Config(commands::config::Config),
28 EnsureOrbRegistered(commands::ensure_orb_registered::EnsureOrbRegistered),
30 Generate(Box<commands::generate::Generate>),
32 Init(Box<commands::init::Init>),
34 Update(commands::update::Update),
36}
37
38impl Cli {
39 pub fn run(&self) -> Result<()> {
41 match &self.command {
42 Commands::Config(cmd) => cmd.run(),
43 Commands::EnsureOrbRegistered(cmd) => cmd.run(),
44 Commands::Generate(cmd) => cmd.run(),
45 Commands::Init(cmd) => cmd.run(),
46 Commands::Update(cmd) => cmd.run(),
47 }
48 }
49}