Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude path option #86

Open
voidexpr opened this issue Dec 9, 2021 · 2 comments
Open

exclude path option #86

voidexpr opened this issue Dec 9, 2021 · 2 comments

Comments

@voidexpr
Copy link

voidexpr commented Dec 9, 2021

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.

@KSXGitHub
Copy link
Owner

KSXGitHub commented May 5, 2022

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)

@voidexpr
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants