feat(cli): wire together a new command for convert
This commit is contained in:
parent
f230af436c
commit
812ffb30f0
|
@ -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(())
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
pub mod address;
|
pub mod address;
|
||||||
pub mod apply;
|
pub mod apply;
|
||||||
|
pub mod convert;
|
||||||
|
|
||||||
use clap::Subcommand;
|
use clap::Subcommand;
|
||||||
|
|
||||||
|
@ -9,11 +10,13 @@ use clap::Subcommand;
|
||||||
pub enum Cmd {
|
pub enum Cmd {
|
||||||
Address(address::Args),
|
Address(address::Args),
|
||||||
Apply(apply::Args),
|
Apply(apply::Args),
|
||||||
|
Convert(convert::Args),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn exec(cmd: Cmd) -> miette::Result<()> {
|
pub fn exec(cmd: Cmd) -> miette::Result<()> {
|
||||||
match cmd {
|
match cmd {
|
||||||
Cmd::Address(args) => address::exec(args),
|
Cmd::Address(args) => address::exec(args),
|
||||||
Cmd::Apply(args) => apply::exec(args),
|
Cmd::Apply(args) => apply::exec(args),
|
||||||
|
Cmd::Convert(args) => convert::exec(args),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue