Skip to content

Commit

Permalink
improved documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-ardi committed Nov 24, 2023
1 parent 2b2afbc commit dc5f19b
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions cargo-aoc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ use clap::Parser;
about = "Cargo helper for Advent of Code"
)]
pub struct Cli {
#[clap(help = "Specifies the day. Defaults to last implemented.")]
/// Specifies the day. Defaults to last implemented.
#[clap()]
day: Option<Day>,

#[clap(short, long, help = "Specifies the part. Defaults to both parts.")]
/// Specifies the part. Defaults to both parts.
#[clap(short, long)]
part: Option<Part>,

#[clap(short, long, help = "Use an alternate input file.")]
/// Use an alternate input file.
#[clap(short, long)]
input: Option<String>,

#[clap(short, long, help = "Add debug info for profiling tools.")]
/// Add debug info for profiling tools.
#[clap(long)]
profile: bool,

#[clap(subcommand)]
Expand All @@ -39,43 +41,49 @@ enum SubCommands {
Input(Input),
}

/// Runs the benchmark for the last day (or a given day)
#[derive(Parser, Debug)]
pub struct Bench {
#[clap(short, long, help = "Specifies the day. Defaults to last implemented.")]
/// Specifies the day. Defaults to last implemented.
#[clap(short, long)]
day: Option<Day>,

#[clap(short, long, help = "Specifies the part. Defaults to both parts.")]
/// Specifies the part. Defaults to both parts.
#[clap(short, long)]
part: Option<Part>,

#[clap(short, long, help = "Use an alternate input file.")]
/// Use an alternate input file.
#[clap(short, long)]
input: Option<String>,

#[clap(short, long, help = "Opens the benchmark information in the browser")]
/// Opens the benchmark information in the browser
#[clap(short, long)]
open: bool,

#[clap(short, long, help = "Also benchmark generator functions.")]
/// Also benchmark generator functions.
#[clap(short, long)]
generator: bool,

#[clap(short, long, help = "Add debug info for profiling tools.")]
/// Add debug info for profiling tools.
#[clap(long)]
profile: bool,
}

/// Sets the session cookie
#[derive(Parser, Debug)]
pub struct Credentials {
#[clap(short, long, help = "Sets the session cookie")]
set: Option<String>,
}

/// Downloads the input for today (or a given day)
#[derive(Parser, Debug)]
pub struct Input {
#[clap(short, long, help = "Specifies the day. Defaults to today's date.")]
/// Specifies the day. Defaults to today's date.
#[clap(short, long)]
day: Option<u32>,

#[clap(
short,
long,
help = "Specifies the year. Defaults to the current year."
)]
/// Specifies the year. Defaults to the current year.
#[clap(short, long)]
year: Option<i32>,
}

Expand Down

0 comments on commit dc5f19b

Please sign in to comment.