feat(cli): wire together a new command for convert

This commit is contained in:
rvcas 2023-03-02 12:51:25 -05:00 committed by Lucas
parent f230af436c
commit 812ffb30f0
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,27 @@
use std::path::PathBuf;
/// Convert a blueprint into other formats.
#[derive(clap::Args)]
#[clap(setting(clap::AppSettings::DeriveDisplayOrder))]
pub struct Args {
/// Path to project
directory: Option<PathBuf>,
/// Name of the validator's module within the project. Optional if there's only one validator.
#[clap(short, long)]
module: Option<String>,
/// Name of the validator within the module. Optional if there's only one validator.
#[clap(short, long)]
validator: Option<String>,
}
pub fn exec(
Args {
directory,
module,
validator,
}: Args,
) -> miette::Result<()> {
Ok(())
}

View File

@ -1,5 +1,6 @@
pub mod address;
pub mod apply;
pub mod convert;
use clap::Subcommand;
@ -9,11 +10,13 @@ use clap::Subcommand;
pub enum Cmd {
Address(address::Args),
Apply(apply::Args),
Convert(convert::Args),
}
pub fn exec(cmd: Cmd) -> miette::Result<()> {
match cmd {
Cmd::Address(args) => address::exec(args),
Cmd::Apply(args) => apply::exec(args),
Cmd::Convert(args) => convert::exec(args),
}
}