use clap::{Parser, Subcommand, ValueEnum};
pub use crate::Template as TemplateBase;
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Debug)]
pub enum Template {
Web,
Cli,
Embedded,
}
impl From<Template> for TemplateBase {
fn from(t: Template) -> Self {
match t {
Template::Web => TemplateBase::Web,
Template::Cli => TemplateBase::Cli,
Template::Embedded => TemplateBase::Embedded,
}
}
}
#[derive(Parser, Debug)]
#[command(name = "xert")]
#[command(version = "0.1.0")]
#[command(about = "A professional Rust project scaffolding tool", long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
Create {
#[arg(value_enum)]
template: Template,
name: String,
},
}