Commit Graph

492 Commits

Author SHA1 Message Date
wickles
0038cb24b4 Fix filename completions for zsh and bash (#331) 2023-07-14 18:32:21 +01:00
andy.boot
658f8d2e2b ci: Add musl arm build
ci: Add musl arm build
2023-05-07 11:50:49 +01:00
andy.boot
2c23336794 Increment version
Request for security fix
https://github.com/bootandy/dust/issues/324
2023-05-05 20:40:52 +01:00
andy.boot
a4ae013459 cargo update: update dependencies 2023-05-05 20:40:52 +01:00
JCallicoat
c259d3b566 Add support for cargo-binstall to Cargo.toml
Add support for cargo-binstall to find github release builds.
2023-04-02 20:42:26 +01:00
andy.boot
bdfd3c01a5 cargo update: update dependencies 2023-03-14 20:59:31 +00:00
andy.boot
2fe91806c7 Increment version v0.8.5 2023-03-14 08:18:23 +00:00
andy.boot
514bb2799c Fix: some panics are occuring when creating rayon
Wrap and ignore these panics.

I can't reproduce this problem but I'm curious to know if this fixes it
2023-03-14 08:15:19 +00:00
Efertone
e17a1af476 remove depth from config.toml and fix style issues
Signed-off-by: Efertone <efertone@pm.me>
2023-03-06 21:43:15 +00:00
Efertone
2f7c197cd7 feat: default option for depth from config file
- If `--depth` flag is not defined (or it has an invalid value), a value
  from the config file will be used.
- If no `depth` entry in the config file (or there is no config file),
  the default `usize::MAX` will be used.

Added test cases:
- no config and no flag defined              -> `usize::MAX` should be used
- config defined, but flag is not defined    -> config value should be used
- config is not defined, but flag is defined -> flag value should be used
- both config and flag is defined            -> flag value should be used

Additional changes:

- Fixed some clippy issues.
- Added comments to the example `config.toml` file.
  (copy from flag description)

Closes: #314

Signed-off-by: Balazs Nadasdi <efertone@pm.me>
2023-03-06 21:43:15 +00:00
andy.boot
7d13fe972c refactor: DisplayData 2023-02-04 11:20:50 +00:00
andy.boot
5a3e15d0ce refactor: simplify filter.rs 2023-02-04 11:20:50 +00:00
andy.boot
6db013a601 Update README.md
more parameters
2023-01-29 10:46:39 +00:00
andy.boot
49a21b1121 Increment version v0.8.4 2023-01-29 10:24:36 +00:00
andy.boot
7efdf63fbc fix: Stop progress indicator crashing into stderr 2023-01-29 10:24:36 +00: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
1e87a0661b fix: Fix bug in progress bar
Must entirely clear screen before printing output
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
520c439edc Update LICENSE 2023-01-27 22:47:59 +00:00
Alexander Kjäll
712acc67fe use create_dir_all instead of create_dir as that doesn't fail if the directory already exists, and make sure to propagate the error out 2023-01-27 22:45:45 +00:00
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