Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions datetime/cal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@ use clap::Parser;
use gettextrs::{bind_textdomain_codeset, gettext, setlocale, textdomain, LocaleCategory};
use plib::PROJECT_NAME;

/// cal - print a calendar
#[derive(Parser, Debug)]
#[command(author, version, about, long_about)]
#[derive(Debug, Parser)]
#[command(version, about = gettext("cal - print a calendar"))]
struct Args {
/// Specify the month to be displayed, represented as a decimal integer from 1 (January) to 12 (December).
#[arg(value_parser = clap::value_parser!(u32).range(1..))]
#[arg(
value_parser = clap::value_parser!(u32).range(1..),
help = gettext(
"Specify the month to be displayed, represented as a decimal integer from 1 (January) to 12 (December)"
)
)]
month: Option<u32>,

/// Specify the year for which the calendar is displayed, represented as a decimal integer from 1 to 9999.
#[arg(value_parser = clap::value_parser!(u32).range(1..))]
#[arg(
value_parser = clap::value_parser!(u32).range(1..),
help = gettext(
"Specify the year for which the calendar is displayed, represented as a decimal integer from 1 to 9999"
)
)]
year: Option<u32>,
}

Expand Down