mirror of
https://github.com/bootandy/dust.git
synced 2025-12-05 20:40:11 -08:00
* 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>
74 lines
3.4 KiB
Plaintext
74 lines
3.4 KiB
Plaintext
#compdef dust
|
|
|
|
autoload -U is-at-least
|
|
|
|
_dust() {
|
|
typeset -A opt_args
|
|
typeset -a _arguments_options
|
|
local ret=1
|
|
|
|
if is-at-least 5.2; then
|
|
_arguments_options=(-s -S -C)
|
|
else
|
|
_arguments_options=(-s -C)
|
|
fi
|
|
|
|
local context curcontext="$curcontext" state line
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-d+[Depth to show]: : ' \
|
|
'--depth=[Depth to show]: : ' \
|
|
'-n+[Number of lines of output to show. (Default is terminal_height - 10)]: : ' \
|
|
'--number-of-lines=[Number of lines of output to show. (Default is terminal_height - 10)]: : ' \
|
|
'*-X+[Exclude any file or directory with this name]: : ' \
|
|
'*--ignore-directory=[Exclude any file or directory with this name]: : ' \
|
|
'-z+[Minimum size file to include in output]: : ' \
|
|
'--min-size=[Minimum size file to include in output]: : ' \
|
|
'(-e --filter -t --file_types)*-v+[Exclude filepaths matching this regex. To ignore png files type: -v "\\.png$" ]: : ' \
|
|
'(-e --filter -t --file_types)*--invert-filter=[Exclude filepaths matching this regex. To ignore png files type: -v "\\.png$" ]: : ' \
|
|
'(-t --file_types)*-e+[Only include filepaths matching this regex. For png files type: -e "\\.png$" ]: : ' \
|
|
'(-t --file_types)*--filter=[Only include filepaths matching this regex. For png files type: -e "\\.png$" ]: : ' \
|
|
'-w+[Specify width of output overriding the auto detection of terminal width]: : ' \
|
|
'--terminal_width=[Specify width of output overriding the auto detection of terminal width]: : ' \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
'-V[Print version information]' \
|
|
'--version[Print version information]' \
|
|
'-p[Subdirectories will not have their path shortened]' \
|
|
'--full-paths[Subdirectories will not have their path shortened]' \
|
|
'-L[dereference sym links - Treat sym links as directories and go into them]' \
|
|
'--dereference-links[dereference sym links - Treat sym links as directories and go into them]' \
|
|
'-x[Only count the files and directories on the same filesystem as the supplied directory]' \
|
|
'--limit-filesystem[Only count the files and directories on the same filesystem as the supplied directory]' \
|
|
'-s[Use file length instead of blocks]' \
|
|
'--apparent-size[Use file length instead of blocks]' \
|
|
'-r[Print tree upside down (biggest highest)]' \
|
|
'--reverse[Print tree upside down (biggest highest)]' \
|
|
'-c[No colors will be printed (Useful for commands like: watch)]' \
|
|
'--no-colors[No colors will be printed (Useful for commands like: watch)]' \
|
|
'-b[No percent bars or percentages will be displayed]' \
|
|
'--no-percent-bars[No percent bars or percentages will be displayed]' \
|
|
'--skip-total[No total row will be displayed]' \
|
|
'-f[Directory '\''size'\'' is number of child files/dirs not disk size]' \
|
|
'--filecount[Directory '\''size'\'' is number of child files/dirs not disk size]' \
|
|
'-i[Do not display hidden files]' \
|
|
'--ignore_hidden[Do not display hidden files]' \
|
|
'(-d --depth)-t[show only these file types]' \
|
|
'(-d --depth)--file_types[show only these file types]' \
|
|
'-H[print sizes in powers of 1000 (e.g., 1.1G)]' \
|
|
'--si[print sizes in powers of 1000 (e.g., 1.1G)]' \
|
|
'-P[Disable the progress indication.]' \
|
|
'--no-progress[Disable the progress indication.]' \
|
|
'-D[Only directories will be displayed.]' \
|
|
'--only-dir[Only directories will be displayed.]' \
|
|
'*::inputs:' \
|
|
&& ret=0
|
|
}
|
|
|
|
(( $+functions[_dust_commands] )) ||
|
|
_dust_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'dust commands' commands "$@"
|
|
}
|
|
|
|
_dust "$@"
|