1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

df: error on duplicate columns in --output arg

Print a usage error when duplicat column names are specified to the
`--output` command-line argument. For example,

    $ df --output=source,source
    df: option --output: field ‘source’ used more than once
    Try 'df --help' for more information.
This commit is contained in:
Jeffrey Finkelstein 2022-03-27 22:02:55 -04:00
parent d5d6bc3050
commit 6f32a1921a
3 changed files with 85 additions and 24 deletions

View file

@ -264,3 +264,11 @@ fn test_output_file_specific_files() {
]
);
}
#[test]
fn test_output_field_no_more_than_once() {
new_ucmd!()
.arg("--output=target,source,target")
.fails()
.usage_error("option --output: field 'target' used more than once");
}