Commit Graph

266 Commits

Author SHA1 Message Date
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
andy boot c6f4ace2b6 Merge pull request #30 from bootandy/neaten
Neaten
2019-10-02 19:16:31 +01:00
Bob d46b63fad8 Add detection of files which fail permission
Old code caught some file permission denied but not all.
2019-10-01 22:44:17 +01:00
Bob 872a49bb7d better var name 2019-10-01 22:35:29 +01:00
andy boot 04c6c204c3 Merge pull request #27 from bootandy/new2 2019-10-01 22:26:56 +01:00
Bob 7ac01e8166 Increment version number 2019-10-01 22:18:36 +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
Bob 2ca2cebdad New Cargo lock 2019-09-29 11:28:51 +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 d327bd2e68 Fix code to handle single dots in path
Before this fix adding a single dot to the end of a path would cause the
code to crash.
2019-07-02 00:56:43 +01:00
bootandy 7db6cf2f32 Add test to handle single dot in path 2019-07-02 00:54:58 +01:00
bootandy 76d0762c97 Add assert to stop infinite loops 2019-07-01 22:43:10 +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 4906e9efda comment typos 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
bootandy 12775db94b Update git ignore to ignore idea 2019-07-01 22:25:06 +01:00
bootandy bfaf5ee173 Add bash line to ci script 2019-07-01 22:25:06 +01:00
bootandy fd68330815 Update cargo lock 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 cab24f58d5 Merge pull request #20 from bootandy/refac
Refactor
2018-05-10 18:28:07 +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 6a86e8befd Increment version number v0.3.1 2018-05-09 11:46:42 +01:00
andy boot 3fb91a6c29 Merge pull request #19 from bootandy/rm_dup_input
code to remove duplicate arguments
2018-05-09 11:44:38 +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
andy boot 65cd42736a Update README.md 2018-05-09 09:43:30 +01:00
andy boot 4792e97177 Merge pull request #18 from bootandy/fixes
Fixes
2018-05-02 09:51:21 +01:00
bootandy 3e9f09e339 Remove unnecessary path & pathbuf code 2018-05-02 00:42:03 +01:00
bootandy dba465a094 Tweak error message 2018-05-02 00:39:57 +01:00
bootandy 25d1ee7b43 Remove naked unwrap 2018-05-02 00:39:57 +01:00
bootandy 2556885622 Rust format 2018-05-02 00:39:57 +01:00
bootandy 8c088a7026 Fix: Passing a string into -n will no longer panic
fixes: #https://github.com/bootandy/dust/issues/16
2018-05-02 00:39:57 +01:00
bootandy 39db8b86fd Replace simple match with map_or 2018-05-01 14:38:34 +01:00
bootandy c5830c5d00 Stop using target_os just use target_family
target_family unix covers linux and mac and wraps up the call for inodes
in a common interface.
2018-05-01 13:59:48 +01:00
bootandy b68c450710 use eprintln! 2018-05-01 13:55:19 +01:00
andy.boot 6e2e5761d8 Increment version 2018-04-27 12:46:27 +01:00
andy boot 6842526d2c Merge pull request #15 from bootandy/depth2
Add support for -d depth flag
2018-04-27 12:28:15 +01:00
andy.boot 4ac85d7dc9 Simplify tests
dust sort is now more predictable as it orders first by size and second
by name.

Walkdir still gives different iteration orders on different systems so
all output is not entirely predictable
2018-04-27 11:35:47 +01:00
andy.boot 8170a07886 Increase default to 20 from 15
Clean up README a bit.
2018-04-27 10:23:20 +01:00
andy.boot 0f1f823736 Add long options to cmd line params 2018-04-27 10:15:30 +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 0bded9698a Merge pull request #14 from bootandy/fix_mac
Fix tests on mac
2018-04-24 17:09:30 +01:00
bootandy c7f0ea59f0 Fix tests on mac
Macos does not appear to have a predictable iteration order of the files
2018-04-24 16:50:37 +01:00