mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
df: allow multiple occurrences of --output arg
Allow multiple occurrences of the `--output` argument. For example,
$ df --output=source --output=target | head -n1
Filesystem Mounted on
This commit is contained in:
@@ -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"])
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user