use crate::config::{CStandard, ProjectType};
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "Smidr", version = "0.7.0", long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
#[command(alias = "n")]
New {
name: String,
#[arg(long, value_enum, conflicts_with = "lib")]
r#type: Option<ProjectType>,
#[arg(long)]
lib: bool,
#[arg(long, value_enum)]
std: Option<CStandard>,
},
#[command(alias = "b")]
Build {
#[arg(long)]
release: bool,
},
#[command(alias = "r")]
Run {
#[arg(long)]
release: bool,
},
#[command(alias = "cl")]
Clean,
#[command(alias = "rb")]
Rebuild {
#[arg(long)]
release: bool,
},
#[command(alias = "fmt")]
Format,
#[command(alias = "a")]
Add { name: String },
#[command(alias = "rm")]
Remove { name: String },
}
pub fn parse_args() -> Cli {
Cli::parse()
}