mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
date: allow multiple -d, last wins
This commit is contained in:
@@ -275,6 +275,7 @@ pub fn uu_app() -> Command {
|
||||
.long(OPT_DATE)
|
||||
.value_name("STRING")
|
||||
.allow_hyphen_values(true)
|
||||
.overrides_with(OPT_DATE)
|
||||
.help(translate!("date-help-date")),
|
||||
)
|
||||
.arg(
|
||||
|
||||
@@ -504,6 +504,19 @@ fn test_invalid_date_string() {
|
||||
.stderr_contains("invalid date");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_multiple_dates() {
|
||||
new_ucmd!()
|
||||
.arg("-d")
|
||||
.arg("invalid")
|
||||
.arg("-d")
|
||||
.arg("2000-02-02")
|
||||
.arg("+%Y")
|
||||
.succeeds()
|
||||
.stdout_is("2000\n")
|
||||
.no_stderr();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_date_one_digit_date() {
|
||||
new_ucmd!()
|
||||
|
||||
Reference in New Issue
Block a user