- 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.
The code calculating the width of a row to use vs the width of the
terminal wasn't quite right.
If we had 2 long filepaths one at the top of the dir tree and one at the
bottom the old code would shorten both equally. This doesn't make sense
as the one at the shallowest part of the tree would have used less
screen real estate and so should show a longer part of the filepath.
Remove note about 'height' and '-h being help' because it confused
people.
Add text to explain default height is terminal height - 10
https://github.com/bootandy/dust/issues/201
For some unknown reason mac takes offence to searching for
'test_dir_unicode'. 'test_dir_hidden' seems to work fine.
This isn't a proper fix as I've just hacked round the problem. Ideally
I'd need a mac user to do some investigation.
Because apparent_size uses the test files created in /tmp it needs to be
in the test_exact_output where those files are copied. Otherwise the files
may not be there when the test is run.