Skip to content

Commit 3988aa6

Browse files
committed
cal: Add gettext for clap
1 parent a43c530 commit 3988aa6

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

datetime/cal.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,23 @@ use clap::Parser;
1616
use gettextrs::{bind_textdomain_codeset, gettext, setlocale, textdomain, LocaleCategory};
1717
use plib::PROJECT_NAME;
1818

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

27-
/// Specify the year for which the calendar is displayed, represented as a decimal integer from 1 to 9999.
28-
#[arg(value_parser = clap::value_parser!(u32).range(1..))]
30+
#[arg(
31+
value_parser = clap::value_parser!(u32).range(1..),
32+
help = gettext(
33+
"Specify the year for which the calendar is displayed, represented as a decimal integer from 1 to 9999"
34+
)
35+
)]
2936
year: Option<u32>,
3037
}
3138

0 commit comments

Comments
 (0)