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 images to be piped in via stdin #27

Merged
merged 1 commit into from Jul 27, 2017

Conversation

crazymerlyn
Copy link
Contributor

@crazymerlyn crazymerlyn commented Jun 27, 2017

Closes #9

If the image-file argument is "-", the program tries to read input from stdin
instead of a file.

The terminal cols function is modified to use stdout instead of stdin so that it produces correct output even if the program is being piped to.

NOTE: I have only tested this on Linux and not Windows. So, while I tried to lookup the differences and modify the program accordingly, it might not work properly.

Closes posva#9

If the image-file argument is "-", the program tries to read input from stdin
instead of a file.
@posva
Copy link
Owner

posva commented Jun 27, 2017

That's pretty cool. Thanks for the PR. I'll test it on OS X
Did you test with all the test images?

@crazymerlyn
Copy link
Contributor Author

Yes, I tested all the test images. The behavior is same for manually passing the filename, piping through cat and using input redirection.

Copy link
Owner

@posva posva left a comment

Choose a reason for hiding this comment

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

Sorry for the late review 😅

@posva posva merged commit 913579d into posva:master Jul 27, 2017
@crazymerlyn crazymerlyn deleted the read_from_stdin branch July 27, 2017 17:37
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.

None yet

2 participants