Skip to content

Add only* flags to show only specified devices info #80

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

Merged
merged 14 commits into from
Nov 1, 2020

Conversation

idsulik
Copy link
Contributor

@idsulik idsulik commented Oct 31, 2020

Add only* flags to show only specified devices info

To show only individual tables:

duf --only-local --only-network --only-fuse --only-special --only-loops --only-binds

To show only specific filesystems:

duf --only-fs tmpfs,vfat

Close #79

@idsulik idsulik changed the title 79 Add only* flags to show only specified devices info Oct 31, 2020
@RangerCD
Copy link
Contributor

I think there are too many flags about showing or hiding specific fs types. Maybe a better way to do this is to simplify those bool flags with a couple of string flags?

For example:

  • --hide-special -> --hide special
  • --hide-local -> --hide local
  • --hide-special --hide-local -> --hide special,local
  • --only-special -> --only special
  • --only-local --only-special -> --only local,special

@muesli
Copy link
Owner

muesli commented Oct 31, 2020

@RangerCD I tend to agree, it's becoming too complex. I also fear that the current logic is really hard to debug & maintain - especially when adding an only flag. We need to be careful here: it's really tough for me to review the logic in this commit, for example.

@idsulik
Copy link
Contributor Author

idsulik commented Oct 31, 2020

@RangerCD agree, made a refactor

@muesli agree with you too, but I have no idea how to refactor to make code clear

@idsulik
Copy link
Contributor Author

idsulik commented Oct 31, 2020

@RangerCD I tend to agree, it's becoming too complex. I also fear that the current logic is really hard to debug & maintain - especially when adding an only flag. We need to be careful here: it's really tough for me to review the logic in this commit, for example.

@RangerCD, review my last commit, I've refactored code. I think it's clear now

@muesli
Copy link
Owner

muesli commented Oct 31, 2020

@idsulik Yeah, this is much cleaner now, nice work!

@muesli muesli added the enhancement New feature or request label Oct 31, 2020
@muesli muesli merged commit 486c72f into muesli:master Nov 1, 2020
@muesli
Copy link
Owner

muesli commented Nov 1, 2020

Awesome, thank you @idsulik!

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

Successfully merging this pull request may close these issues.

[Feature request] Reverse of hide comand line args
3 participants