wookayin / python-imgcat

🖼 imgcat in Python (for iTerm2)
MIT License
244 stars 20 forks source link

[Feature request] pipe arg list #2

Closed albanie closed 5 years ago

albanie commented 5 years ago

Great tool.

It would be v. useful to have the option to do this: ls | xargs imgcat

The main use case (at least for me) is when you want a quick visual summary from a large directory of images. E.g. ls | shuf | head -n 10 | xargs imgcat

This works with the original imgcat, but with python-imgcat, I get the following: error: when reading from stdin, arg should not be given

Thanks!

albanie commented 5 years ago

Closing, since can get it to work with parallel. For anyone interested: ls | grep png | shuf | head | parallel "cat {} | imgcat"

sarnobat commented 5 years ago

It would still be nice if this could be fixed to work with xargs. In fact I can't get it to work with parallel (and would the above work if there is whitespace?).

Since I can't reopen this ticket, I'm reopening the duplicate ticket I filed.

wookayin commented 5 years ago

I had missed this issue. Actually I agree that when stdin and arg are both provided, it can simply ignore stdin, so that xargs can work. Fixed in #3.