8000 df: show error if all types are excluded by cakebaker · Pull Request #3418 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

df: show error if all types are excluded #3418

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 1 commit into from
Apr 20, 2022

Conversation

cakebaker
Copy link
Contributor
@cakebaker cakebaker commented Apr 17, 2022

coreutils df -x ext4 -x tmpfs -x devtmpfs -x vfat will now show an error (this is on my machine, on other machines you might have to specify other types to get the error).

Fixes #3409.

@cakebaker cakebaker force-pushed the ticket_3409 branch 2 times, most recently from b1b874b to 22a46b4 Compare April 18, 2022 12:03
Copy link
Member
@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I just have one question

.arg("--output=fstype")
.succeeds()
.stdout_move_str();
let fs_types: HashSet<_> = fs_types.lines().skip(1).collect();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test! Is there a particular reason to use a HashSet here instead of a Vec? If not then HashSet is still fine, but I'm just curious :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was more of an intuitive decision to use a HashSet. It avoids duplicates because for the test it only matters that a file system type is there, but not how often.

@tertsdiepraam tertsdiepraam merged commit e8574ca into uutils:main Apr 20, 2022
@cakebaker cakebaker deleted the ticket_3409 branch April 21, 2022 05:54
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

Successfully merging this pull request may close these issues.

df: excluding all file system types should cause an error
2 participants
0