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

Feature Request: Don't wait for input to finish before printing #10

Closed
exoji2e opened this issue Jun 7, 2020 · 3 comments
Closed

Feature Request: Don't wait for input to finish before printing #10

exoji2e opened this issue Jun 7, 2020 · 3 comments

Comments

@exoji2e
Copy link

exoji2e commented Jun 7, 2020

Hi! Cool project, very nice alternative to awk/cut.

It would be nice to be able to use choose on an endless stream, passing on output as new lines arrives on stdin. Some examples:

ping 8.8.8.8 | choose -2 | choose -f "=" 1
tail -f log.log | choose 0

Of course using the approach of printing the match after each line is highly inefficient working on files. Maybe it could be a setting --release-output which by default is not used when reading files, but used when reading from stdin?

@theryangeary
Copy link
Owner

Hi @exoji2e I agree, this is one of the things I've been thinking needs some work. Ideally without any need for a flag or switch. Stay tuned.

@theryangeary
Copy link
Owner

As an update, I believe this will take some async/await or tokio code but I don't know too much about that. It will happen eventually but I don't exactly how long it will take to get there. I don't think it should take too much work I just need to better understand async.

@theryangeary
Copy link
Owner

Merged in develop

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