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

Allow trurl to read from stdin using pipes. #277

Closed
wants to merge 21 commits into from

Conversation

jacobmealey
Copy link
Contributor

@jacobmealey jacobmealey commented Mar 8, 2024

This adds the ability to use pipes to read from stdin. Note that this keeps the -f - style as is, but can be removed if folks want that.
Example usage:

$ echo "www.google.com" | trurl 
http://www.google.com/
$ cat someurls.txt | trurl --get "{scheme}"
https
https
git
http
ftp
$ (trurl -s query="foo=bar") < someurls.txt
https://curl.se/?foobar
https://docs.python.org/?foobar
git://github.com/curl/curl.git?foobar

fixes #275

@jacobmealey
Copy link
Contributor Author

Okay, it took an embarrassingly long time to figure out why it was failing. turns out github runners do weird things with standard in, but made some more bugs visible. Anyway, it should be all good now.

@jacobmealey
Copy link
Contributor Author

okay something is busted on the tests runners in a way im not sure how to reproduce locally (they run fine on both my mac and linux machines). I'm gonna close this PR and rethink how to do these tests.

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.

Read from stdin by default
1 participant