Skip to content

Commit 7181a00

Browse files
committed
feat: added --version option
* `--version` now prints the version of the application.
1 parent b54e4d4 commit 7181a00

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
[package]
33
name = "elv"
44
description = "A little CLI helper for Advent of Code. 🎄"
5-
version = "0.12.0"
5+
version = "0.12.1"
6+
authors = ["Konrad Pagacz <[email protected]>"]
67
edition = "2021"
78
readme = "README.md"
89
license-file = "LICENSE"

src/cli/cli_interface.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
use super::cli_command::CliCommand;
22

3-
#[derive(Debug, clap::Parser)]
43
/// 🎄 Your Advent of Code CLI 🎄
54
///
65
/// This CLI is a tool to help you with your Advent of Code challenges.
6+
#[derive(Debug, clap::Parser)]
7+
#[command(version)]
78
pub struct CliInterface {
8-
#[arg(short, long)]
99
/// Your Advent of Code session token
1010
///
1111
/// You can find your session token by logging into Advent of Code and
1212
/// inspecting the cookies of the page. The session token is the value of
1313
/// the cookie named "session".
14+
#[arg(short, long)]
1415
pub token: Option<String>,
1516

16-
#[arg(short, long, requires("day"), value_parser = clap::value_parser!(u16))]
1717
/// The year of the challenge
1818
///
1919
/// 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))]
2021
pub year: Option<u16>,
2122

22-
#[arg(short, long, requires("year"), value_parser = clap::value_parser!(u8))]
2323
/// The day of the challenge
2424
///
2525
/// If you do not supply a day, the current day of the month will be used
2626
/// (if the current month is December).
27+
#[arg(short, long, requires("year"), value_parser = clap::value_parser!(u8))]
2728
pub day: Option<u8>,
2829

2930
#[command(subcommand)]

0 commit comments

Comments
 (0)