ouch-org / ouch

Painless compression and decompression in the terminal
https://crates.io/crates/ouch
Other
2.18k stars 75 forks source link

Support decompressing stdin #687

Closed rcorre closed 1 week ago

rcorre commented 1 month ago

With tar, I can run something like curl .../file.tar.gz | tar xvz. It would be nice if ouch supported that for formats where streaming is possible.

marcospb19 commented 1 month ago

Nice suggestion, this has been a suggestion for a couple years now and it's definitely something I'd merge in.

rcorre commented 1 month ago

Should we use a - arg to indicate that the archive is being passed on stdin, or infer it if there are no file args, and stdin is not a tty?

marcospb19 commented 1 month ago

I believe - is the way to go for STDIN.

And actually, this should probably be used for compression (and listing) too (tho decompression is a nice place to start).

rcorre commented 1 month ago

If - is a filename, should I be able to run ouch d foo.tgz - bar.tgz to decompress two files and one stdin stream, or should - have to appear as a single exclusive file argument? I can't think of any reason you'd want to mix stdin and regular files, but just wanted to check.