aoc-toolkit 0.1.0-alpha.3

A toolkit for solving Advent of Code problems
Documentation
use clap::Args;

use crate::application::run::RunOptions;

#[derive(Debug, Args)]
pub struct RunArgs {
    #[arg(short, long)]
    year: Option<usize>,

    #[arg(
        short,
        long,
        value_parser = clap::value_parser!(u8).range(1..=25)
    )]
    day: Option<u8>,

    #[arg(
        short,
        long,
        value_parser = clap::value_parser!(u8).range(1..=2)
    )]
    part: Option<u8>,

    #[arg(long, conflicts_with_all(["day", "part"]))]
    all: bool,
}

impl From<RunArgs> for RunOptions {
    fn from(args: RunArgs) -> Self {
        Self {
            year: args.year,
            day: args.day,
            part: args.part,
            all: args.all,
        }
    }
}