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,
},
}
fn main() {
let cli = Cli::parse();
let result = match cli.command {
Commands::New { name, no_frontend } => {
let base = PathBuf::from(".");
commands::new::run(&name, &base, no_frontend)
}
};
if let Err(e) = result {
eprintln!("Error: {}", e);
std::process::exit(1);
}
}