mod account;
pub use account::*;
mod build;
pub use build::*;
mod clean;
pub use clean::*;
mod deploy;
pub use deploy::*;
mod new;
pub use new::*;
mod run;
pub use run::*;
mod update;
pub use update::*;
use anyhow::Result;
use clap::Parser;
#[derive(Debug, Parser)]
#[clap(name = "aleo", author = "The Aleo Team <hello@aleo.org>", setting = clap::AppSettings::ColoredHelp)]
pub struct CLI {
#[clap(default_value = "2", short, long)]
pub verbosity: u8,
#[clap(subcommand)]
pub command: Command,
}
#[derive(Debug, Parser)]
pub enum Command {
#[clap(subcommand)]
Account(Account),
#[clap(name = "build")]
Build(Build),
#[clap(name = "clean")]
Clean(Clean),
#[clap(name = "deploy")]
Deploy(Deploy),
#[clap(name = "new")]
New(New),
#[clap(name = "run")]
Run(Run),
#[clap(subcommand)]
Update(Update),
}
impl Command {
pub fn parse(self) -> Result<String> {
match self {
Self::Account(command) => command.parse(),
Self::Build(command) => command.parse(),
Self::Clean(command) => command.parse(),
Self::Deploy(command) => command.parse(),
Self::New(command) => command.parse(),
Self::Run(command) => command.parse(),
Self::Update(command) => command.parse(),
}
}
}