When running:
dust dir_a dir_b
if a file was hard linked in both dir_a and dir_b it would be double
counted.
This fix resolves this by keeping the shared hashmap around between runs
for the second and subsequent arguments.
https://github.com/bootandy/dust/issues/282
Small boxes do not have enough memory to create a large stack
Conversely we want a large stack size for large boxes with a very highly
nested directory structure.
Version: New version
Dislike the idea of passing a string into build_cli. By removing
a call to default_value we can side-step the problem.
Downside is we lose the error log if a user provides a bad depth
- Try to use iterator adapters and collect in various places, where possible. This especially benefits draw_it.
- Try to use `.map` and other similar methods on Options and Results, where possible
- Replaced nearly all clones with reference-based equivalents
- Summarizing nodes by file extension is now much more efficient
- PartialOrd and PartialEq implementations now agree
- Replace #[cfg(...)] function definitions with simpler if cfg!(...) equivelents
- Simplify CLI Values handling by taking advantage of Values::default
- Various spelling corrections in comments
- Add `ColorState` enum to replace bool, for clarity
- Fix tests that break under some detected terminal widths when paths are long
- Use sort_by instead of (sort, reverse)
- Use new `ExtensionNode` struct internally to simplify extension aggregation code
Stop incorrect reporting of "Did not have permissions" this would
happen where dust is called with a file instead of a directory.
https://github.com/bootandy/dust/issues/241
todo: add test
Before we assumed 5 chars for printing the size of a node. This change
allows us to check if we need 5 chars or if we can manage with 4 which
may save us a character.
(1023B = 5 chars, 1.2K = 4 chars)
Note: Mac test runners create very long filenames in tmp directories. To
fix this we must either
1) Tell the terminal it has a very wide width
2) Duplicate the code to reduce the size of the filename (add .. at the
end).
This commit changes from (2) to (1)
Now files are iterated thru in a preditermined order we can tighten the
boundaries of the test_hard_sym_link test.
Link will not be displayed, only the file name
Sort the Node objects so that duplicate inodes appear in a predictable
order.
Include new sort_by_inode method because this is notably quicker than
sorting by size & name as defined in the nodes.rs file.
Low stack size could result in a stack overflow exception if traversing
very highly nested directories.
This makes core-dumps less likely but will not completely remove the
risk
example for creating directories:
mkdir -p $(for i in {1..5000}; do echo -n "qwe/"; done)
original issue:
https://github.com/bootandy/dust/issues/197
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.