571 Commits

Author SHA1 Message Date
Alexander Kjäll
fdbed14334 generate a man page as part of the build 2023-01-27 22:45:45 +00:00
andy.boot
810cc8b604 clippy: Fix new clippy rules 2023-01-26 23:37:55 +00:00
Alexander Kjäll
83ef2525aa upgrade dependencies 2023-01-26 23:05:14 +00:00
andy.boot
af9f0b5125 refactor: progress bar
Pull out display code into different functions

Experimented with printing the actual directory currently being parsed
but this resulted into too many flickering hard to follow prints. It's
cleaner to just print the target directory rather than the directory
currently being examined by the dir_walker.
2023-01-22 09:56:47 +00:00
andy.boot
9ff28b3456 refactor: progress bar
code to clear line should be just before next write. Otherwise
a buffer flush may occur that wipes out the line before it can be read
by the user.
2023-01-22 09:56:47 +00:00
andy.boot
4242363f40 refactor: progress bar
Change threading to use channels instead of atomic boolean

Allows for early exit so we don't have to wait for spinner loop timeout
2023-01-21 16:40:21 +00:00
andy.boot
3fd78490e6 Comment: Remove comment
This can't be done easily
2023-01-21 16:40:21 +00:00
andy.boot
b903f58cea Comment: update comment 2023-01-21 16:40:21 +00:00
andy.boot
0f72ca328a Refactor: rename var 2023-01-21 16:40:21 +00:00
andy.boot
6c130adb6c Refactor: PAtomicInfo class 2023-01-17 23:34:20 +00:00
andy.boot
9f0f366187 Refactor: progress bar & file permissions
Move permissions flag into shared pdata object.

Fixed bug where permissions flag was not being set correctly
2023-01-17 23:34:20 +00:00
andy.boot
81ad921e25 Refactor: progress bar: rename vars 2023-01-17 23:34:20 +00:00
andy.boot
3708edc2d3 Refactor: Progress bar: Remove atomic classes
On balance I'm not convinced these macro built wrapper classes are worth
it - It's clearer to use the standard atomic classes
2023-01-17 23:34:20 +00:00
andy.boot
414bc9e5a7 Refactor: Progress bar: Remove PConfig 2023-01-17 23:34:20 +00:00
andy.boot
66ad504848 Refactor: progress bar: simplify 2023-01-17 23:34:20 +00:00
andy.boot
5bfa44ec77 Refactor: progress bar: rm unused field 2023-01-17 23:34:20 +00:00
andy.boot
03a8d643c5 Refactor: Simplify progress indicator
Reduce & simlpify.

Cut feature: where we only report file count, it is always
useful to see file size as well.

cut feature: plural of file. If dust has only indexed a single file by
the time it prints the status then something has gone wrong, safe to
always assume a plural.
2023-01-14 16:51:32 +00:00
andy.boot
29957c1f2c refactor: update Progress bar: progress.rs
Remove none-needed macro
2023-01-14 16:51:32 +00:00
andy.boot
400ff513f4 Refactor: Update main for progress bar 2023-01-14 16:51:32 +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
ea3cc537ea Fix: naming of parameter 2023-01-08 11:51:32 +00:00
andy.boot
c012567c38 [documentation] Note about running single-threaded 2023-01-08 10:28:19 +00:00
andy.boot
26bc26277d refactor dir_walker
I find this layout cleaner
2023-01-07 14:49:02 +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
andy.boot
a3ab5bfe0f refactor create AggregateData for filter.rs 2023-01-07 14:16:03 +00:00
andy.boot
04c4963a02 refactor filter.rs 2023-01-07 14:16:03 +00:00
andy.boot
40a6f098ae refactor filter.rs 2023-01-07 14:16:03 +00:00
andy.boot
5e607cf210 Fix: depth=0 bug for multiple arguments
https://github.com/bootandy/dust/issues/282
2023-01-05 09:22:38 +00:00
andy.boot
f546dbbede 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
2023-01-05 09:22:38 +00:00
andy.boot
a91aa62060 clippy: Fix new clippy 2023-01-04 20:08:20 +00:00
andy.boot
a7b82f32d7 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)
2023-01-04 20:08:20 +00:00
Guillaume Gomez
72b811c278 Update sysinfo version to 0.26.7 2023-01-04 19:38:40 +00:00
Phil Clifford
b478534b22 added deb-get as installation source 2022-10-24 23:25:13 +01:00
DIRE
2ca7177446 FEATURE: support only directories will be displayed. Flag -D 2022-10-05 23:26:10 +01:00
Collin Styles
e858f9e976 Read inputs from stdin when applicable 2022-10-01 11:16:14 +01:00
Collin Styles
0a67191054 Add a direct dependency on the atty crate 2022-10-01 11:16:14 +01:00
andy.boot
c363e5ff8b Fix: Only create large stack size if enough memory
Small boxes do not have enough memory to create a large stack

Conversely we want a large stack size for large boxes with a very highly
nested directory structure.

Version: New version
v0.8.3
2022-08-31 21:14:56 +01:00
Kian-Meng Ang
c148cd9044 Prettify md/yaml file
Resolved via `prettier --write .`
2022-08-24 08:59:30 +01:00
Kian-Meng Ang
2893f73f47 Fix typos
Found via `codespell -L crate`.
2022-08-24 08:55:00 +01:00
andy.boot
5103ebe0d8 Version: Increment version 2022-08-23 12:26:08 +01:00
andy.boot
40acc8f868 README: Update readme to include max-size 2022-08-23 11:47:18 +01:00
andy.boot
eebd9daf2a Feature: Add error message on bad min-size
Log to stderr if the min-size from either parameter or config is invalid
2022-08-23 11:47:18 +01:00
andy.boot
9bc1a6d625 Refactor: Tidy up use of UNITS: k,m,g,t 2022-08-23 11:47:18 +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
andy.boot
f70f4b7e12 CI: Only run against latest ubuntu builds
Copying lsd's CI which only builds against latest ubuntu releases.
2022-08-23 09:30:01 +01:00
andy.boot
b9b2aee760 Cleanup: Clean previous commit.
Dislike the idea of passing a string into build_cli. By removing
a call to default_value we can side-step the problem.

Downside is we lose the error log if a user provides a bad depth
2022-08-23 09:12:07 +01:00
Jedsek
f60184ecbb Fix the hard code of max depth 2022-08-23 09:11:13 +01:00
Jedsek
81d52e6e3a Support for completions 2022-08-23 09:11:13 +01:00
andy.boot
5980858b39 Feature: Config file
Read flags for several params from config file.

This was a popular requested feature (many people want to run with -r on
by default).
2022-08-22 12:05:04 +01:00