mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Support listing directories by number of files
Based of https://github.com/bootandy/dust/pull/104 Idea is to allow users to find the number of files in each directory instead of size.
This commit is contained in:
+10
@@ -120,6 +120,13 @@ fn main() {
|
||||
.long("no-percent-bars")
|
||||
.help("No percent bars or percentages will be displayed"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("by_filecount")
|
||||
.short("f")
|
||||
.long("filecount")
|
||||
.help("Directory 'size' is number of child files/dirs not disk size"),
|
||||
)
|
||||
|
||||
.arg(Arg::with_name("inputs").multiple(true))
|
||||
.get_matches();
|
||||
|
||||
@@ -157,6 +164,7 @@ fn main() {
|
||||
Some(i) => Some(i.map(PathBuf::from).collect()),
|
||||
None => None,
|
||||
};
|
||||
let by_filecount = options.is_present("by_filecount");
|
||||
|
||||
let simplified_dirs = simplify_dir_names(target_dirs);
|
||||
let (permissions, nodes) = get_dir_tree(
|
||||
@@ -164,6 +172,7 @@ fn main() {
|
||||
&ignore_directories,
|
||||
use_apparent_size,
|
||||
limit_filesystem,
|
||||
by_filecount,
|
||||
depth,
|
||||
);
|
||||
let sorted_data = sort(nodes);
|
||||
@@ -181,6 +190,7 @@ fn main() {
|
||||
!options.is_present("reverse"),
|
||||
no_colors,
|
||||
options.is_present("no_bars"),
|
||||
by_filecount,
|
||||
tree,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user