zoi_cli/cmd/package/
mod.rs1use anyhow::Result;
2use clap::{Parser, Subcommand};
3pub mod build;
4pub mod bundle;
5pub mod doctor;
6pub mod init_lsp;
7pub mod inspect;
8pub mod install;
9pub mod test;
10
11#[derive(Parser, Debug)]
12pub struct PackageCommand {
13 #[command(subcommand)]
14 command: Commands,
15}
16
17#[derive(Subcommand, Debug)]
18enum Commands {
19 Build(build::BuildCommand),
21 Bundle(bundle::BundleCommand),
23 Test(build::BuildCommand),
25 Install(install::InstallCommand),
27 Doctor(doctor::DoctorCommand),
29 InitLsp(init_lsp::InitLspCommand),
31 Inspect(inspect::InspectCommand),
33}
34
35pub fn run(args: PackageCommand) -> Result<()> {
36 match args.command {
37 Commands::Build(cmd) => build::run(cmd),
38 Commands::Bundle(cmd) => bundle::run(cmd),
39 Commands::Test(cmd) => test::run(cmd),
40 Commands::Install(cmd) => install::run(cmd),
41 Commands::Doctor(cmd) => doctor::run(cmd),
42 Commands::InitLsp(cmd) => init_lsp::run(cmd),
43 Commands::Inspect(cmd) => inspect::run(cmd),
44 }
45}