mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Support excluding filesystems with -x
https://github.com/bootandy/dust/issues/50 Add optional -x flag to limit search to the current filesystem. Add (untested) support for windows for the equivalent of inode and device.
This commit is contained in:
+13
-1
@@ -54,6 +54,12 @@ fn main() {
|
||||
.long("full-paths")
|
||||
.help("If set sub directories will not have their path shortened"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("limit_filesystem")
|
||||
.short("x")
|
||||
.long("limit-filesystem")
|
||||
.help("Only count the files and directories in the same filesystem as the supplied directory"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("display_apparent_size")
|
||||
.short("s")
|
||||
@@ -110,9 +116,15 @@ fn main() {
|
||||
}
|
||||
|
||||
let use_apparent_size = options.is_present("display_apparent_size");
|
||||
let limit_filesystem = options.is_present("limit_filesystem");
|
||||
|
||||
let simplified_dirs = simplify_dir_names(target_dirs);
|
||||
let (permissions, nodes) = get_dir_tree(&simplified_dirs, use_apparent_size, threads);
|
||||
let (permissions, nodes) = get_dir_tree(
|
||||
&simplified_dirs,
|
||||
use_apparent_size,
|
||||
limit_filesystem,
|
||||
threads,
|
||||
);
|
||||
let sorted_data = sort(nodes);
|
||||
let biggest_ones = {
|
||||
match depth {
|
||||
|
||||
Reference in New Issue
Block a user