mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
date: fix invalid argument error for RFC 3339 (#4535)
This commit is contained in:
@@ -314,6 +314,7 @@ pub fn uu_app() -> Command {
|
||||
Arg::new(OPT_RFC_3339)
|
||||
.long(OPT_RFC_3339)
|
||||
.value_name("FMT")
|
||||
.value_parser([DATE, SECOND, SECONDS, NS])
|
||||
.help(RFC_3339_HELP_STRING),
|
||||
)
|
||||
.arg(
|
||||
|
||||
@@ -43,6 +43,13 @@ fn test_date_rfc_3339() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_date_rfc_3339_invalid_arg() {
|
||||
for param in ["--iso-3339", "--rfc-3"] {
|
||||
new_ucmd!().arg(format!("{param}=foo")).fails();
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_date_rfc_8601_default() {
|
||||
let re = Regex::new(r"^\d{4}-\d{2}-\d{2}\n$").unwrap();
|
||||
|
||||
Reference in New Issue
Block a user