mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
date: Fix format optional argument to capture all following parameters (#10914)
This commit is contained in:
@@ -624,7 +624,7 @@ pub fn uu_app() -> Command {
|
||||
.help(translate!("date-help-universal"))
|
||||
.action(ArgAction::SetTrue),
|
||||
)
|
||||
.arg(Arg::new(OPT_FORMAT).num_args(0..).trailing_var_arg(true))
|
||||
.arg(Arg::new(OPT_FORMAT).num_args(0..))
|
||||
}
|
||||
|
||||
fn format_date_with_locale_aware_months(
|
||||
|
||||
@@ -51,6 +51,15 @@ fn test_invalid_short_option() {
|
||||
.stderr_contains("unexpected argument '-w'");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_format_option_not_to_capture_other_valid_arguments() {
|
||||
new_ucmd!()
|
||||
.arg("+%Y%m%d%H%M%S")
|
||||
.arg("--date")
|
||||
.arg("@1770996496")
|
||||
.succeeds();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_single_dash_as_date() {
|
||||
new_ucmd!()
|
||||
|
||||
Reference in New Issue
Block a user