mod init;
use clap::{Parser, Subcommand, ValueEnum};
#[derive(Parser)]
#[command(name = "cfasim", about = "CFA Simulator CLI")]
struct Cli {
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand)]
enum Commands {
Init {
#[arg(long, default_missing_value = ".")]
dir: Option<String>,
#[arg(long)]
template: Option<TemplateArg>,
#[arg(long)]
local: bool,
},
}
#[derive(Clone, ValueEnum)]
enum TemplateArg {
Python,
Rust,
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
let cli = Cli::parse();
match cli.command {
Commands::Init {
dir,
template,
local,
} => {
let template = template.map(|t| match t {
TemplateArg::Python => init::Template::Python,
TemplateArg::Rust => init::Template::Rust,
});
init::run(dir, template, local)?;
}
}
Ok(())
}