github_heatmap/utils/
args.rs

1use super::parsers::{parse_slug, parse_year};
2use clap::{Parser, ValueEnum};
3
4/// Scrapes a Github profile, and generates a contributions heatmap in Unicode
5#[derive(Parser, Debug)]
6#[clap(author, version, about)]
7pub struct Args {
8    /// Github profile slug, e.g. adenh93
9    #[clap(value_parser = parse_slug)]
10    pub slug: String,
11
12    /// Heatmap color scheme. Nodes will be shaded depending on heat level.
13    #[clap(short, long, value_enum, default_value_t = ColorValues::Green)]
14    pub color: ColorValues,
15
16    /// Specific year to fetch contributions
17    #[clap(short, long, value_parser = parse_year)]
18    pub year: Option<String>
19}
20
21#[derive(ValueEnum, Debug, Clone)]
22pub enum ColorValues {
23    Red,
24    Green,
25    Blue,
26}