Skip to content

Commit

Permalink
Merge pull request #3327 from cakebaker/ticket_3324
Browse files Browse the repository at this point in the history
df: --output w/o "=" doesn't expect further args
  • Loading branch information
sylvestre authored Mar 28, 2022
2 parents b07b71e + a68d77b commit d6fd701
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/uu/df/src/df.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions tests/by-util/test_df.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d6fd701

Please sign in to comment.