use std::path::PathBuf;
use clap::{ArgAction, Parser, Subcommand};
#[derive(Subcommand, PartialEq)]
pub enum Command {
Build {
#[arg(
long,
default_value = "debug",
default_value_if("release", "true", Some("release")),
help = "Build profile"
)]
profile: String,
#[arg(long, help = "Build with release profile (equivalent to --profile=release)", action = ArgAction::SetTrue)]
release: bool,
#[arg(long, help = "Don't emit compile_commands.json", action = ArgAction::SetTrue)]
no_compile_commands: bool,
},
Init,
}
#[derive(Parser)]
#[command(
author = "Madeleine Choi <madeleine@choi.moe>",
version = "0.1.0",
about = "Saja is a zero-configuration build system for C."
)]
pub struct Arguments {
#[arg(
long,
default_value = ".saja/",
help = "Output directory for internal build files"
)]
pub build: PathBuf,
#[arg(short, long, help = "Enable verbose logging", action = ArgAction::SetTrue)]
pub verbose: bool,
#[command(subcommand)]
pub command: Command,
}