Read NUL- or newline-terminated paths from FILE or stdin.
Wire options through `config` and `main`. Add tests and update the
man page, README, and completion scripts.
If we run `dust /usr/*/Trash`
We see several 'Trash' directories in the output but do not know which
user they belong to.
This fix means if we see duplicate names in a directory we will display
the parent directory name as well
Provide "No such file or directory" error if file is not found.
Provide "Unknown Error" if other error found
Should reduce confusion from the generic other error
- If `--depth` flag is not defined (or it has an invalid value), a value
from the config file will be used.
- If no `depth` entry in the config file (or there is no config file),
the default `usize::MAX` will be used.
Added test cases:
- no config and no flag defined -> `usize::MAX` should be used
- config defined, but flag is not defined -> config value should be used
- config is not defined, but flag is defined -> flag value should be used
- both config and flag is defined -> flag value should be used
Additional changes:
- Fixed some clippy issues.
- Added comments to the example `config.toml` file.
(copy from flag description)
Closes: #314
Signed-off-by: Balazs Nadasdi <efertone@pm.me>
- 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
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)
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.
-t = Show summary of types
-e = Filter by regex
allows you to specify a file type like -e "\.txt$"
Change behaviour of '-f' flag - it now counts only files. Before it
counted files & directories. This was needed for compatibility with
the new '-e' filter flag
Move apparent size test to 'test_flags' file. We can no longer test the
exact output of this test as it changes too much on different filesystems
Move common code to shared initialization function in test_flags.rs
Code changes:
Removed ignore & channel crates. Using a single reciever thread to build
a hashmap to prevend duplicate inodes being reported gave a severe
performance penalty
Using rayon crate with some hand crafted file traversal has improved
performance aprox 10X
Behaviour changes:
Removed parameter 'limit by filesystem' - don't think this is used, and
I only added it as it was easy to add with the ignore crate.
Sym links will now not appear in the output tree unless using '-s'
'apparent-size' flag
Change behaviour of multiple args so that it unifies them and
compares them under one tree instead of treating them
individually: https://github.com/bootandy/dust/issues/136