zoi/cmd/package/
mod.rs

1use clap::{Parser, Subcommand};
2
3pub mod build;
4pub mod install;
5
6#[derive(Parser, Debug)]
7pub struct PackageCommand {
8    #[command(subcommand)]
9    command: Commands,
10}
11
12#[derive(Subcommand, Debug)]
13enum Commands {
14    /// Build a package from a pkg.lua file
15    Build(build::BuildCommand),
16    /// Install a package from a local archive
17    Install(install::InstallCommand),
18}
19
20pub fn run(args: PackageCommand) {
21    match args.command {
22        Commands::Build(cmd) => build::run(cmd),
23        Commands::Install(cmd) => install::run(cmd),
24    }
25}