diff --git a/src/uu/df/src/df.rs b/src/uu/df/src/df.rs index ee2ea83a068..525e2f08615 100644 --- a/src/uu/df/src/df.rs +++ b/src/uu/df/src/df.rs @@ -388,6 +388,8 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(OPT_OUTPUT) .long("output") .takes_value(true) + .min_values(0) + .require_equals(true) .use_value_delimiter(true) .multiple_occurrences(true) .possible_values(OUTPUT_FIELD_LIST) diff --git a/tests/by-util/test_df.rs b/tests/by-util/test_df.rs index 4c87fc63eb7..b178c40c029 100644 --- a/tests/by-util/test_df.rs +++ b/tests/by-util/test_df.rs @@ -80,6 +80,11 @@ fn test_output_option() { new_ucmd!().arg("--output=invalid_option").fails(); } +#[test] +fn test_output_option_without_equals_sign() { + new_ucmd!().arg("--output").arg(".").succeeds(); +} + #[test] fn test_type_option() { new_ucmd!().args(&["-t", "ext4", "-t", "ext3"]).succeeds();