mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Fix: Allow -n to be used with -d
Allow -n for number_of_lines to be used with -d 'max depth' Remove depth specific functions, the job is now handled by the mainline Add depth as a field onto the Node object.
This commit is contained in:
@@ -12,6 +12,7 @@ pub struct Node {
|
||||
pub size: u64,
|
||||
pub children: Vec<Node>,
|
||||
pub inode_device: Option<(u64, u64)>,
|
||||
pub depth: usize,
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
@@ -24,6 +25,7 @@ pub fn build_node(
|
||||
is_symlink: bool,
|
||||
is_file: bool,
|
||||
by_filecount: bool,
|
||||
depth: usize,
|
||||
) -> Option<Node> {
|
||||
match get_metadata(&dir, use_apparent_size) {
|
||||
Some(data) => {
|
||||
@@ -50,6 +52,7 @@ pub fn build_node(
|
||||
size,
|
||||
children,
|
||||
inode_device,
|
||||
depth,
|
||||
})
|
||||
}
|
||||
None => None,
|
||||
|
||||
Reference in New Issue
Block a user