Merge pull request #8550 from schopin-pro/rfc-2822

date: add hidden aliases --rfc-2822/822 for GNU compat
This commit is contained in:
Daniel Hofstetter
2025-09-03 19:02:48 +02:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -37,6 +37,8 @@ const OPT_FILE: &str = "file";
const OPT_DEBUG: &str = "debug";
const OPT_ISO_8601: &str = "iso-8601";
const OPT_RFC_EMAIL: &str = "rfc-email";
const OPT_RFC_822: &str = "rfc-822";
const OPT_RFC_2822: &str = "rfc-2822";
const OPT_RFC_3339: &str = "rfc-3339";
const OPT_SET: &str = "set";
const OPT_REFERENCE: &str = "reference";
@@ -302,6 +304,8 @@ pub fn uu_app() -> Command {
Arg::new(OPT_RFC_EMAIL)
.short('R')
.long(OPT_RFC_EMAIL)
.alias(OPT_RFC_2822)
.alias(OPT_RFC_822)
.help(translate!("date-help-rfc-email"))
.action(ArgAction::SetTrue),
)
+1 -1
View File
@@ -19,7 +19,7 @@ fn test_invalid_arg() {
#[test]
fn test_date_email() {
for param in ["--rfc-email", "--rfc-e", "-R"] {
for param in ["--rfc-email", "--rfc-e", "-R", "--rfc-2822", "--rfc-822"] {
new_ucmd!().arg(param).succeeds();
}
}