Skip to content

Commit 9cd81d9

Browse files
committed
time: Add locale
1 parent 02fa19e commit 9cd81d9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

datetime/time.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ use plib::PROJECT_NAME;
2020

2121
#[derive(Parser)]
2222
#[command(
23-
version,
2423
about = gettext("time - time a simple command or give resource usage"),
25-
help_template = gettext("{about-with-newline}\nUsage: {usage}\n\nArguments:\n{positionals}\n\nOptions:\n{options}")
24+
help_template = gettext("{about}\n\nUsage: {usage}\n\nArguments:\n{positionals}\n\nOptions:\n{options}"),
25+
version = env!("CARGO_PKG_VERSION"),
26+
disable_help_flag = true,
27+
disable_version_flag = true,
2628
)]
2729
struct Args {
2830
#[arg(
@@ -41,6 +43,12 @@ struct Args {
4143
help = gettext("Arguments for the utility")
4244
)]
4345
arguments: Vec<String>,
46+
47+
#[arg(short, long, help = gettext("Print help"), action = clap::ArgAction::HelpLong)]
48+
help: bool,
49+
50+
#[arg(short = 'V', long, help = gettext("Print version"), action = clap::ArgAction::Version)]
51+
version: bool,
4452
}
4553

4654
enum TimeError {

0 commit comments

Comments
 (0)