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.
-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
The old code was subtly different in the way the root node worked. This
changed in the v0.6.0 version when dependencies were removed. The code
to handle file count was never updated
https://github.com/bootandy/dust/issues/162
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
Add support for width flag
https://github.com/bootandy/dust/issues/126
Requested because some people may cat the output
All terminal height/width detection is now in the main file. One method
now has too many args for clippy, this complaint is valid and in the
future we should consider pulling these out into a separate object.
* remove unneeded identity .map()
* remove redunant field name in struct
* impl num_siblings for Node
* replace nested if w/ match in get_tree_chars
* remove unneeded field name in struct
* remove redundant println! & logic in display_node
* make get_children_from_node a Node method
* Revert "remove redundant println! & logic in display_node"
This reverts commit 40777025d5.
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.
Make use of the 'is' more to test the entire output.
Add test for no_color mode.
Replace several calls to format_string with calls that build a string
directly. I feel format_string is becoming unweildly and this simplfies
the tests
Following the large refactor on the previous commit, this commit fixes
the reverse functionality.
Depth detection moved into the tree building instead of being calculated
when drawing the tree to screen
WIP
Replace array of (string, int) pairs with tree of nodes.
A tree of nodes more accurately represents the underlying file structure
and hence is a better fit for the problem space.
Regression: Reverse doesn't work in this commit.
I suspect more methods can be simplifed and reduced.
strip_end_slash_including_root will remove end slashes including the
root directory.
The root directory has been a long running problem because if we strip
the final slash we will run dust on no directory instead of the root.