mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
+2
-1
@@ -287,6 +287,7 @@ fn get_all_filesystems(opt: &Options) -> Vec<Filesystem> {
|
||||
mounts
|
||||
.into_iter()
|
||||
.filter_map(|m| Filesystem::new(m, None))
|
||||
.filter(|fs| opt.show_all_fs || fs.usage.blocks > 0)
|
||||
.collect()
|
||||
}
|
||||
|
||||
@@ -362,7 +363,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
let filesystems = get_all_filesystems(&opt);
|
||||
|
||||
if filesystems.is_empty() {
|
||||
return Err(USimpleError::new(1, "No file systems processed"));
|
||||
return Err(USimpleError::new(1, "no file systems processed"));
|
||||
}
|
||||
|
||||
filesystems
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// spell-checker:ignore udev pcent iuse itotal iused ipcent
|
||||
use std::collections::HashSet;
|
||||
|
||||
use crate::common::util::*;
|
||||
|
||||
#[test]
|
||||
@@ -204,6 +206,27 @@ fn test_exclude_type_option() {
|
||||
new_ucmd!().args(&["-x", "ext4", "-x", "ext3"]).succeeds();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_exclude_all_types() {
|
||||
let fs_types = new_ucmd!()
|
||||
.arg("--output=fstype")
|
||||
.succeeds()
|
||||
.stdout_move_str();
|
||||
let fs_types: HashSet<_> = fs_types.lines().skip(1).collect();
|
||||
|
||||
let mut args = Vec::new();
|
||||
|
||||
for fs_type in fs_types {
|
||||
args.push("-x");
|
||||
args.push(fs_type.trim_end());
|
||||
}
|
||||
|
||||
new_ucmd!()
|
||||
.args(&args)
|
||||
.fails()
|
||||
.stderr_contains("no file systems processed");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_include_exclude_same_type() {
|
||||
new_ucmd!()
|
||||
|
||||
Reference in New Issue
Block a user