parallel-disk-usage icon indicating copy to clipboard operation
parallel-disk-usage copied to clipboard

exclude path option

Open voidexpr opened this issue 2 years ago • 2 comments

It would be great to be able to exclude some paths, for example: pdu $HOME -E subdir1 -E subdir2 or maybe even more fined grain like some specific extensions or filenames (but path is my main use case). For completeness an include could also be useful when it's easier to filter by inclusion than exclusion.

voidexpr avatar Dec 09 '21 16:12 voidexpr

Sorry for late response. It is unlikely that I will implement this feature for the following reasons:

  • It is very hard to implement this feature without compromising performance for the use case without -E.
  • My aim is to make pdu minimal and composable: Minimal for the sake of maintenance; Composable is to allow other programs to compensate what pdu is lacking.

So the right way to exclude directory is to combine with external programs. For example:

pdu $(find . -maxdepth 1 -mindepth 1 -name '*' -a -not -name excluded-dir)
pdu $(fd -d 1 -E excluded-dir)

KSXGitHub avatar May 05 '22 04:05 KSXGitHub

I doubt adding an if condition/virtual call to check an exclude filter will meaningfully impact performance. Dust is making 'du' user friendly so in this spirit an exclude option would be a great fit as it is a very common use case in my experience. Find is actually another command that is not user friendly with a convoluted syntax. Thank you for considering the feature and replying. Hopefully you'll have a change of heart at some point :-) Dust is great, thank you for making it.

voidexpr avatar May 16 '22 15:05 voidexpr