andy.boot
a4ca78dbe4
Add option flag for no colors
...
https://github.com/bootandy/dust/issues/37
2019-12-08 14:46:45 +00:00
andy.boot
78119aba0f
Mark function as ignored by clippy
...
We don't want to collapse this if - it is easier to reason about this
way
2019-12-05 21:50:26 +00:00
Xavier L'Heureux
b66523cff3
Apply clippy lints
2019-12-03 18:34:47 -05:00
Matt Vertescher
99003cbba9
Upgrade to the 2018 edition
2019-10-26 15:19:07 -04:00
andy.boot
0c19a66432
Add test for reverse flag
2019-10-08 20:57:44 +01:00
andy.boot
4cffc4370b
Bring back the reverse flag
...
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
2019-10-06 22:00:40 +01:00
andy.boot
db6c8a019d
Massive refactor
...
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.
2019-10-05 17:57:47 +01:00
andy.boot
e03094a4fa
Add reverse flag
...
Pull several variables related to how output is printed
into DisplayData struct
2019-10-03 23:07:52 +01:00
andy.boot
1d9a56e025
A way of supporting reverse
2019-10-02 22:31:49 +01:00
andy.boot
ec2d9e19d4
Run format, introduce new function.
...
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.
2019-10-02 20:14:13 +01:00
andy.boot
9fbfcb275a
pull out a method
...
(will be needed for reverse)
2019-10-02 20:06:09 +01:00
andy.boot
1c60d1e2ac
Display: replace boolean with integer count
...
This will probably be useful when i refactor for the reverse mode
2019-10-02 19:54:00 +01:00
andy.boot
fd35734a94
Simplify string code, remove into
2019-10-02 19:48:57 +01:00
Bob
2f7a88e8dc
Fix issues from running on root directory
...
clean up: 80338f4
Fixes -d flag to work again. Add test to stop regression
2019-10-01 22:18:16 +01:00
bootandy
80338f4731
Fix running on root dir /
...
Fixes: https://github.com/bootandy/dust/issues/22
Allows code to run on the root directory
2019-07-04 00:03:33 +01:00
bootandy
6e03dd77e6
Fix obscure display bug
...
When one directory was a substring of another with files in the files
could appear as children of the wrong directory
Fix: https://github.com/bootandy/dust/issues/25
2019-07-01 22:25:06 +01:00
bootandy
876609f2cb
Obey new clippy
...
Clippy is like having a reviewer fix your dodgy code.
2019-07-01 22:25:06 +01:00
andy.boot
0bf4ebf554
Fix minor color bug
...
If we are not using RED then the Color should be the terminal default
not 7
2018-06-19 23:39:23 +01:00
andy.boot
b1b933d851
Refactor & Optimize use of depth
...
Code Refactored
Using Depth now prunes the tree below the displayable depth so display
calls finish quicker.
2018-05-10 17:36:56 +01:00
andy.boot
51561994c5
Break up display_node function slightly
...
Also: run rustformat
2018-05-09 11:28:23 +01:00
andy.boot
ce0e14bf00
Tweak output - the root node now has a: ─┬
2018-05-09 10:58:32 +01:00
andy.boot
dd75ec4aa7
wip: code to remove duplicate arguments
...
Also handle case where an argument is a substring of another argument
2018-05-09 10:35:30 +01:00
bootandy
25d1ee7b43
Remove naked unwrap
2018-05-02 00:39:57 +01:00
andy.boot
e6c777fb8b
Add support for -d depth flag
...
Following a user request the option '-d N' allows a user to output N
levels of sub directories.
Fixed bug: so that trailing slashes are now removed.
2018-04-27 10:01:41 +01:00
andy.boot
803934d84b
By default only print last leaf of path
...
Fixes #9
https://github.com/bootandy/dust/issues/9
Instead of printing the all sub tree leaves only the last leaf is now
printed. See readme change for example
The flag '-p' was added to print the sub tree the old way
2018-04-24 14:54:11 +01:00
andy.boot
24c97ef92f
Rewrite to use walkdir instead of recursion
...
Advised to use walkdir by burntsushi as using recursion on file systems
can blow the stack.
walkdir is slower but allows the code to be cleaner and more reliable
Also experimented with ignore but locking the hashmap resulted in
similar performance to walkdir but with much uglier code.
2018-04-24 14:53:47 +01:00
andy.boot
0c5b08e1d2
Change package name to du-dust
...
The binary is still called dust. Sadly dust was taken on crates.io.
This change should allow us to send this crate to crates.io
2018-04-18 13:40:52 +01:00
bootandy
385ddb75e1
Minor code neatening
2018-04-06 20:35:00 +01:00
bootandy
5c6165da8a
First integration test
...
This test needs neatening but it is the first example of a working
integration test
2018-04-05 14:45:04 +01:00
bootandy
778dbb44b3
Remove graying background
...
Remove background that gets grayer.
1) This looks funny on terminals that aren't black
2) Makes testing easier
2018-04-04 23:12:00 +01:00
bootandy
6a63cbe1bc
fix: Dust was supposed to take multiple dir args
...
Dust will now work when given multiple dirs. Before this fix it would
only show the largest dir.
2018-04-03 17:54:45 +01:00
bootandy
120b4e16e7
Squash Node and DirEnt objects into single object
2018-04-03 17:05:28 +01:00
bootandy
6198e3183f
pull units variable out as constant
2018-04-03 16:37:29 +01:00
bootandy
ecf6c8f0e5
Refactor: Pull display code out to different file
2018-03-22 17:21:51 -04:00