Skip to main content

aoc_zen_runner/
cli.rs

1use clap::{Parser, Subcommand, Args};
2
3#[derive(Parser, Clone, Debug)]
4#[command(author, version, about, long_about = None)]
5pub enum Cli {
6    #[command(name = "aoc")]
7    Aoc(Aoc)
8}
9
10#[derive(Clone, Debug, Args)]
11pub struct Aoc {
12    // TODO: Spec out a config file. If we need one.
13    // /// Sets a custom config file
14    // #[arg(short, long, value_name = "FILE")]
15    // config: Option<PathBuf>,
16    /// Generate more verbose output
17    #[arg(short, long, action = clap::ArgAction::Count)]
18    pub verbose: u8,
19
20    #[arg(short, long)]
21    pub day: Option<u8>,
22
23    #[arg(short, long)]
24    pub year: Option<u16>,
25
26    #[command(subcommand)]
27    pub command: Option<Commands>,
28}
29
30#[derive(Subcommand, Clone, Debug)]
31pub enum Commands {
32    /// Log in to the Advent of Code website for input downloading
33    Login,
34
35    /// Download problem inputs from Advent of Code
36    Input,
37
38    /// Do setup work for a given day or year
39    Prep,
40
41    /// Run a specific day's solution
42    Run,
43
44    /// Benchmark your solution code with more precision
45    Bench,
46
47    /// Run your code against unit tests defined in the code
48    Test,
49    // /// Generate flamegraphs of CPU time used by your solution code
50    // Flamegraph,
51
52    // /// Run the Coz causal profiler on your solution code
53    // Profile,
54}