|
1 | 1 | use super::cli_command::CliCommand;
|
2 | 2 |
|
3 |
| -#[derive(Debug, clap::Parser)] |
4 | 3 | /// 🎄 Your Advent of Code CLI 🎄
|
5 | 4 | ///
|
6 | 5 | /// This CLI is a tool to help you with your Advent of Code challenges.
|
| 6 | +#[derive(Debug, clap::Parser)] |
| 7 | +#[command(version)] |
7 | 8 | pub struct CliInterface {
|
8 |
| - #[arg(short, long)] |
9 | 9 | /// Your Advent of Code session token
|
10 | 10 | ///
|
11 | 11 | /// You can find your session token by logging into Advent of Code and
|
12 | 12 | /// inspecting the cookies of the page. The session token is the value of
|
13 | 13 | /// the cookie named "session".
|
| 14 | + #[arg(short, long)] |
14 | 15 | pub token: Option<String>,
|
15 | 16 |
|
16 |
| - #[arg(short, long, requires("day"), value_parser = clap::value_parser!(u16))] |
17 | 17 | /// The year of the challenge
|
18 | 18 | ///
|
19 | 19 | /// If you do not supply a year, the current year will be used.
|
| 20 | + #[arg(short, long, requires("day"), value_parser = clap::value_parser!(u16))] |
20 | 21 | pub year: Option<u16>,
|
21 | 22 |
|
22 |
| - #[arg(short, long, requires("year"), value_parser = clap::value_parser!(u8))] |
23 | 23 | /// The day of the challenge
|
24 | 24 | ///
|
25 | 25 | /// If you do not supply a day, the current day of the month will be used
|
26 | 26 | /// (if the current month is December).
|
| 27 | + #[arg(short, long, requires("year"), value_parser = clap::value_parser!(u8))] |
27 | 28 | pub day: Option<u8>,
|
28 | 29 |
|
29 | 30 | #[command(subcommand)]
|
|
0 commit comments