Skip to content

Commit 2264932

Browse files
committed
Feat - struct 0 means struct tends to infinite
1 parent 4b7c6f1 commit 2264932

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ sudo cp target/release/struct /usr/local/bin/
4444

4545
```bash
4646
struct 3 # Show structure up to depth 3
47+
struct 0 # Show everything (infinite depth)
4748
struct -g 2 # Git-tracked files only
4849
struct -s 100 3 # Skip folders larger than 100MB
4950
struct -i "*.log" 2 # Add custom ignore patterns

src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,13 @@ fn main() {
170170
}
171171
}
172172

173-
let depth = args.depth.unwrap_or(3);
173+
// Depth 0 means infinite, otherwise use provided depth or default to 3
174+
let depth = match args.depth {
175+
Some(0) => usize::MAX, // Infinite depth
176+
Some(d) => d,
177+
None => 3, // Default depth
178+
};
179+
174180
let max_size_bytes = args.max_size_mb.map(|mb| mb * 1024 * 1024);
175181

176182
// Load config patterns

0 commit comments

Comments
 (0)