use bpaf::Bpaf;
#[derive(Debug, Clone)]
pub enum AngleUnit {
Radian,
Degrees,
}
#[derive(Bpaf, Debug)]
#[bpaf(options, version)]
pub struct Args {
#[bpaf(short('d'), long("degrees"), switch, map(|b| if b {AngleUnit::Degrees} else {AngleUnit::Radian}))]
pub angle_unit: AngleUnit,
#[bpaf(
short,
long,
guard(fix_in_range, "fix must be in range 0-63"),
fallback(None)
)]
pub fix: Option<usize>,
#[bpaf(long, fallback(false))]
pub no_color: bool,
#[bpaf(long)]
pub debug: bool,
}
fn fix_in_range(fix: &Option<usize>) -> bool {
match fix {
None => true,
Some(fix) => (0..64).contains(fix),
}
}