use clap::{Args, ValueEnum};
#[derive(Args)]
#[command(after_help = r#"Examples:
aid build
aid build check
aid build clippy -- --all-targets
For trusted test runs (zero-match is an error, named executed tests), use `aid test`."#)]
pub struct BuildArgs {
#[arg(value_enum)]
pub command: Option<BuildCommandArg>,
#[arg(short = 'p', long)]
pub package: Option<String>,
#[arg(long)]
pub warnings: bool,
#[arg(last = true, allow_hyphen_values = true)]
pub extra_args: Vec<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
pub enum BuildCommandArg {
Check,
Clippy,
}
#[derive(Args)]
#[command(after_help = r#"Examples:
aid test
aid test --bin aid
aid test --bin aid paths::aid_dir -- --exact
aid test -- my_filter
aid test --lib
aid test --isolated --bin aid my_test
Target selectors are aid flags (`--lib`, `--bin`, `--test NAME` = target, not
name filter). Free args after `--` are harness args (filter / --exact / …).
Guarantees: zero-match filter fails (positional or after `--`); no targets
never looks like a pass; digest names tests; failures stay compact."#)]
pub struct TestArgs {
#[arg(short = 'p', long)]
pub package: Option<String>,
#[arg(long)]
pub bin: Option<String>,
#[arg(long)]
pub lib: bool,
#[arg(long = "test")]
pub test_target: Option<String>,
pub filter: Option<String>,
#[arg(long)]
pub isolated: bool,
#[arg(long)]
pub warnings: bool,
#[arg(last = true, allow_hyphen_values = true)]
pub extra_args: Vec<String>,
}