1use anyhow::Result;
2use clap::{Parser, Subcommand};
3
4pub mod build;
5pub mod install;
6pub mod test;
7
8#[derive(Parser, Debug)]
9pub struct PackageCommand {
10 #[command(subcommand)]
11 command: Commands,
12}
13
14#[derive(Subcommand, Debug)]
15enum Commands {
16 Build(build::BuildCommand),
18 Test(build::BuildCommand),
20 Install(install::InstallCommand),
22}
23
24pub fn run(args: PackageCommand) -> Result<()> {
25 match args.command {
26 Commands::Build(cmd) => build::run(cmd),
27 Commands::Test(cmd) => test::run(cmd),
28 Commands::Install(cmd) => install::run(cmd),
29 }
30}