https://github.com/bootandy/dust/issues/92
Not 100% sure if this code is clean yet, may well be a better way to do
it
Also:
Added test directory with incredably long name as test case.
Update test_symlinks.py for mac runners. Mac test runners create files
with very long names, hence the tests fail periodically unless they look
for a truncated name with '..' at the end.
The enum variant `ansi_term::Colour::Red` (which uses the ANSI color code `31`)
is used instead of the code `196` to display the size of the largest file. This
means that the red color of the terminal theme is used which is probably
preferred by most users.
enable_ansi_support must be run for windows 10 but is not required and
indeed fails if run on windows < 10.
Disable the expect so the code might run on windows 8
may fix:
https://github.com/bootandy/dust/issues/70
Use the whole width of the terminal assume width of 80 if none found
Show percentages in the final column. Show ASCII bars indicating usage
of the underlying directories in the space inbetween.
Display (height of terminal - 10) entries by default.
Reverse the output order so largest is at the bottom.
Break up tests. Change older tests to check real output of program.
This code now won't compile on none-(windows/unix family)
systems. [unix family includes mac]
Removing this method allows us to remove an Option and simplify the code
slightly
.# [why]
"If you use `from_path()` on a directory, then subsequent queries using that handle will fail."
Instead, use `from_path_any()` which supports opening files or directories.
ref: "Struct winapi_util::Handle" from <https://docs.rs/crate/winapi-util>
The MetadataExt functions are nightly-only right now so we need to call
the windows api ourselves to get the device number. The winapi_util
package has a nice wrapper to do this for us.
The get_device function doesn't appear to be used anywhere so I removed
it.
https://github.com/bootandy/dust/issues/46
Add -X flag used to ignore any file or directory that matches the
provided substring.
This means that -X e will ignore any file or directory with an 'e' in
it.
Force dust to use 2 threads if there is only 1 cpu
JWalk breaks if it tries to run on a single cpu
https://github.com/jessegrosjean/jwalk/issues/15
This is a hack because I can't figure out how to fix JWalk.
This code and the num_cpu crate can be removed when the bug is fixed
Also I have conflated cpus with cores while describing this issue. It is
very difficult to test as I don't have a single core machine.
Removes unwrap and returns a Result instead of panicing if an invalid
path is given.
Previously if the flag: '-x' was provided with an argument of an
invalid directory the code would crash here
https://github.com/bootandy/dust/issues/50
Add optional -x flag to limit search to the current filesystem.
Add (untested) support for windows for the equivalent of inode and
device.
* Initialize ansi_term if we're on windows
* Silence build warning on non-unix targets
* Update ansi-term which has windows specific fixes (and assert_cli while I'm at it)