35 Commits

Author SHA1 Message Date
Junghyeon Park
7974e2eaf0 feat: support --files-from/--files0-from
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.
2025-10-06 20:11:01 +01:00
andy.boot
51dc167345 deps: cargo update (#510)
* hack

* Revert "hack"

This reverts commit d51c5b890439ec5ea46a10454801f9ca3593afca.

* deps: upgrade
2025-07-05 09:42:26 +01:00
Shun Sakai
702f0f0fe9 chore(cli): Migrate to Derive API
Change the definition of CLI from the Builder API to the Derive API.
2025-05-16 22:09:27 +01:00
andy.boot
1b4116e39d fix: all arguments now use '-' instead of '_' (#484)
* cli: unify long arguments (dashes instead of underscores)

* completions: autoregen completions

---------

Co-authored-by: Pavel Kulyov <kulyov.pavel@gmail.com>
2025-04-01 23:18:49 +01:00
andy.boot
a962b80eec deps: cargo update 2025-02-06 00:30:39 +00:00
andy.boot
01c0aaeade feat: New --collapse flag
--collapse will keep that directory collapsed and will not expand it.
2025-01-27 22:00:08 +00:00
n4n5
eeb686562d push config option 2025-01-15 19:14:00 +00:00
wugeer
f48fcc790a feat: support Dust tree by age 2024-08-07 19:31:22 +01:00
n4n5
394231683d feat: Add flag to read from file/stdin (#405)
* from standard

* improve

* happy clippy

* explicit arg option

* fix problem
2024-06-27 23:51:47 +01:00
wugeer
d65f41097e feat: Added the ability to filter the corresponding files based on the access time, modify time, and change time of the file for statistics 2024-06-24 23:35:25 +01:00
n4n5
08e4240b41 add cli 2024-06-19 21:48:55 +01:00
andy.boot
5b87260467 feat: Adding threads flag
Thanks: Dj-Codeman
2024-05-06 20:26:02 +01:00
Fukushima Shogo
184ea1f956 Added json output function 2024-05-02 23:03:41 +01:00
Taro Tanaka
e2fe656296 Redo 'Fix zsh completion' with clap
Because I'm not familiar with Rust, when I was working on
https://github.com/bootandy/dust/pull/390 I didn't realize that the
completions were auto-generated via clap. I'm sorry. This redoes it
with clap.

This improves not only the completions but also the --help and the
man page. Also the --output-format flag will raise an error if the
given value is invalid.
2024-05-01 20:19:58 +01:00
Taro Tanaka
ecd6b85c17 Fix zsh completion
- Use `_files` to complete file paths
- Add `_dust_output_formats` for -o/--output-format
- Add missing headings

Fixes https://github.com/bootandy/dust/issues/359
2024-04-26 21:20:14 +01:00
n4n5
fbd34ec4c2 Better handling for color in terminal (#381)
* better handling for color in terminal

* cleanup

* cleanup

* cargo fmt

* clippy + tests

* clean
2024-03-25 21:50:29 +00:00
andy.boot
ebb3b8cceb refactor: merge --si and --display-kb
add new option: --output-format this controls how the output is
summarised and takes:

 nothing = default behaviour
 si = SI units (same as old --si flag)
 b = bytes
 kb = kb
 kib = si kb
 mb = mb
 mib = si mb
....etc
2024-03-14 20:30:03 +00:00
zhaotao1
e9bacdf875 feat: display the size of a file or directory in "kilobytes"
feat: display the size of a file or directory in "kilobytes"
2024-03-14 20:30:03 +00:00
andy.boot
10168e0a47 cargo update 2024-01-29 22:41:42 +00:00
andy.boot
cd53fc7494 feat: new param: ignore-all-in-file
Add new cmd line param to ignore all files or directories listed in this
file
2024-01-03 22:24:23 +00:00
andy.boot
e8c7990a17 feat: Custom stack size
If a user reports a crash from stacksize - we can try different stack
memory sizes to try and figure out the cause.

Do not try and initialise rayon on 32 bit builds

Fix rayon initialisation, may not have been called before due to badly
formed closure
2024-01-03 21:46:05 +00:00
andy.boot
c8b61d2f46 dependency: upgrade to clap 4 2023-12-11 23:07:54 +00:00
andy.boot
6e0505bfd7 feat: Reverse direction of bars
Add bars on right option

Add tests
2023-11-23 22:34:24 +00:00
andy.boot
8b1632dde8 docs: Fix filecount docs
We count files not files + folders
2023-11-21 21:24:43 +00:00
andy.boot
2fa14ca19c cargo update: update dependencies (#341) 2023-11-06 23:21:13 +00:00
wickles
0038cb24b4 Fix filename completions for zsh and bash (#331) 2023-07-14 18:32:21 +01:00
andy.boot
184d1ec5e8 Feature: Add flag for screen readers
Screen reader mode will,
Reverse direction
Not shows symbols (directory hierarchy or percentage bars)
Adds a column 'depth' to show depth of directory
2023-01-29 09:52:10 +00:00
andy.boot
187b8be2fa fix: only-dir flag conflicts with types
If showing file types we can't limit output to directories only
2023-01-29 09:52:10 +00:00
andy.boot
1495251ebc feature: --files-only -F
Add feature to only show files skipping directories.
2023-01-29 09:34:40 +00:00
andy.boot
31eb650fbe Refactor: Reduce complexity of progress bar code 2023-01-14 16:51:32 +00:00
NovaliX
f3c074759d Implemented a progress indicator (#275)
* v1.0

* renamed operations to be more clear

* put info later because there is still operations par of the preparing process

* updated the last line clearing

* changed name of module and structs to ones that make more sens

* Disable size computation when file_count option is set

* added sleep during the thread waiting

* use 1024 powered instead of 10 to compute showed number

* include DS_Store

* added files directories skipped information

* small format update

* implement the -H option

* put wait back

* remove PAtomicInfo since it's not used

* cargo fmt

* wrapped atomic operations to reduce overhead

* updated comments

* Use AtomicU64Wrapper instead of AtomicU64 in TotalSize

* update size suffix

* sto dividing size when larger than terabytes

* Fix use_iso flag not be set properly

* update properties display

* some reformating

* use stdout instead of print

* Moved config instance into main because it's easier to read

* merge base formatting into macro

* update name to be more intuitive and separated math operations for more flexibility

* print currently indexed path

* cargo fmt

* reset size between each target dirs

* Access to TotalSize rather than it's inner

* small comment change

* Update sysinfo version to 0.26.7

* fix: update use of sysinfo.system

System is now much quicker to start but requires an explicit call
to refresh memory else it deafults to 0 (oops)

* clippy: Fix new clippy

* fix: bug where hard links could be double counted

When running:
dust dir_a dir_b

if a file was hard linked in both dir_a and dir_b it would be double
counted.

This fix resolves this by keeping the shared hashmap around between runs
for the second and subsequent arguments.
https://github.com/bootandy/dust/issues/282

* Fix: depth=0 bug for multiple arguments

https://github.com/bootandy/dust/issues/282

* refactor filter.rs

* refactor filter.rs

* refactor create AggregateData for filter.rs

* feature: Support for dereference links -L follow

du has -L flag which allows it to dereference or follow
symlinks. Clone this feature into dust.
https://github.com/bootandy/dust/issues/276

* refactor dir_walker

I find this layout cleaner

* v1.0

* changed name of module and structs to ones that make more sens

* Disable size computation when file_count option is set

* added files directories skipped information

* implement the -H option

* wrapped atomic operations to reduce overhead

* used human_readable_number function in display module rather than our own

* implemented progress disabling

* cargo fmt & cargo clippy

Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
Co-authored-by: andy.boot <bootandy@gmail.com>
2023-01-14 11:43:22 +00:00
andy.boot
abcc46c5ea feature: Support for dereference links -L follow
du has -L flag which allows it to dereference or follow
symlinks. Clone this feature into dust.
https://github.com/bootandy/dust/issues/276
2023-01-07 14:49:02 +00:00
DIRE
2ca7177446 FEATURE: support only directories will be displayed. Flag -D 2022-10-05 23:26:10 +01:00
andy.boot
d6f9bb3c47 Feature: Add min-size parameter
Add often requested feature. '--min-size 50000' will only include files
above a size of 50kB
2022-08-23 11:47:18 +01:00
Jedsek
81d52e6e3a Support for completions 2022-08-23 09:11:13 +01:00