Skip to content

Commit c029ddb

Browse files
authored
Merge pull request #8550 from schopin-pro/rfc-2822
date: add hidden aliases --rfc-2822/822 for GNU compat
2 parents 7f68266 + 421d8b7 commit c029ddb

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/uu/date/src/date.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ const OPT_FILE: &str = "file";
3737
const OPT_DEBUG: &str = "debug";
3838
const OPT_ISO_8601: &str = "iso-8601";
3939
const OPT_RFC_EMAIL: &str = "rfc-email";
40+
const OPT_RFC_822: &str = "rfc-822";
41+
const OPT_RFC_2822: &str = "rfc-2822";
4042
const OPT_RFC_3339: &str = "rfc-3339";
4143
const OPT_SET: &str = "set";
4244
const OPT_REFERENCE: &str = "reference";
@@ -302,6 +304,8 @@ pub fn uu_app() -> Command {
302304
Arg::new(OPT_RFC_EMAIL)
303305
.short('R')
304306
.long(OPT_RFC_EMAIL)
307+
.alias(OPT_RFC_2822)
308+
.alias(OPT_RFC_822)
305309
.help(translate!("date-help-rfc-email"))
306310
.action(ArgAction::SetTrue),
307311
)

tests/by-util/test_date.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn test_invalid_arg() {
1919

2020
#[test]
2121
fn test_date_email() {
22-
for param in ["--rfc-email", "--rfc-e", "-R"] {
22+
for param in ["--rfc-email", "--rfc-e", "-R", "--rfc-2822", "--rfc-822"] {
2323
new_ucmd!().arg(param).succeeds();
2424
}
2525
}

0 commit comments

Comments
 (0)