mod commands;
mod templates;
use clap::{Parser, Subcommand};
use std::path::PathBuf;
#[derive(Parser)]
#[command(
name = "lithair",
about = "Lithair project scaffolding tool",
version,
after_help = "See https://github.com/lithair/lithair for full documentation."
)]
struct Cli {
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand)]
enum Commands {
New {
name: String,
#[arg(long)]
no_frontend: bool,
},
Verify {
data_dir: PathBuf,
},
}
fn main() {
let cli = Cli::parse();
match cli.command {
Commands::New { name, no_frontend } => {
let base = PathBuf::from(".");
if let Err(e) = commands::new::run(&name, &base, no_frontend) {
eprintln!("Error: {}", e);
std::process::exit(1);
}
}
Commands::Verify { data_dir } => {
std::process::exit(commands::verify::run(&data_dir));
}
}
}