mod archway;
mod commands;
mod consts;
mod error;
mod executable;
mod utils;
use clap::{command, Parser, Subcommand};
use commands::{
autodeploy::AutoDeployCommand, build::BuildCommand, config::ConfigCommand, init::InitCommand,
new::NewCommand, node::NodeCommand, test::TestCommand,
};
use error::WarpError;
use executable::Executable;
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
#[command(propagate_version = true)]
struct Cli {
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand)]
enum Commands {
Init(InitCommand),
Config(ConfigCommand),
Build(BuildCommand),
Deploy(AutoDeployCommand),
New(NewCommand),
Node(NodeCommand),
Test(TestCommand),
}
fn main() -> Result<(), WarpError> {
let cli = Cli::parse();
match &cli.command {
Commands::Deploy(x) => x.execute(),
Commands::Init(x) => x.execute(),
Commands::New(x) => x.execute(),
Commands::Build(x) => x.execute(),
Commands::Test(x) => x.execute(),
Commands::Node(x) => x.execute(),
Commands::Config(x) => x.execute(),
}?;
Ok(())
}