1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #3323 from jfinkels/df-multiple-output-occurrences

df: allow multiple occurrences of --output arg
This commit is contained in:
Sylvestre Ledru 2022-03-28 08:36:50 +02:00 committed by GitHub
commit b07b71e6be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -389,6 +389,7 @@ pub fn uu_app<'a>() -> Command<'a> {
.long("output")
.takes_value(true)
.use_value_delimiter(true)
.multiple_occurrences(true)
.possible_values(OUTPUT_FIELD_LIST)
.default_missing_values(&OUTPUT_FIELD_LIST)
.default_values(&["source", "size", "used", "avail", "pcent", "target"])

View file

@ -222,6 +222,18 @@ fn test_output_selects_columns() {
);
}
#[test]
fn test_output_multiple_occurrences() {
let output = new_ucmd!()
.args(&["--output=source", "--output=target"])
.succeeds()
.stdout_move_str();
assert_eq!(
output.lines().next().unwrap(),
"Filesystem Mounted on "
);
}
// TODO Fix the spacing.
#[test]
fn test_output_file_all_filesystems() {