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

feat: Add flag to read from file/stdin #405

Merged
merged 6 commits into from
Jun 27, 2024

Conversation

Its-Just-Nans
Copy link
Contributor

@Its-Just-Nans Its-Just-Nans commented Jun 19, 2024

The --files0-from=- option of du

image

image

@rindeal
Copy link
Contributor

rindeal commented Jun 20, 2024

I'm personally in favour of --files-from and --files0-from, but if @bootandy wants a stdin only feature, then it should be enabled just by passing a single - target dir, which is the commonly used CLI semantic in such case.

@Its-Just-Nans
Copy link
Contributor Author

Its-Just-Nans commented Jun 20, 2024

Yes, you're right !

image

image

Note that this still has an issue: fixed below

if someone does dust --files0-from=- without stdin, dust will block on the stdin

image

And you can leave with CTRL+D or kill the program

@Its-Just-Nans
Copy link
Contributor Author

Okay I made a fix using an Arc<AtomicBool> to check if we need to abort

src/main.rs Show resolved Hide resolved
@bootandy
Copy link
Owner

ok, if you think people will use this, i'll include it.

@bootandy bootandy changed the title read from standard feat: Add flag to read from file/stdin Jun 27, 2024
@bootandy bootandy merged commit 3942316 into bootandy:master Jun 27, 2024
17 checks passed
@Its-Just-Nans Its-Just-Nans deleted the from-standard branch June 28, 2024 08:14
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.

3 participants