-
Notifications
You must be signed in to change notification settings - Fork 83
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
Support decompressing to stdout
#110
Comments
I think decompressing to stdout would be a good feature, similar to #6. |
Nice issue.
This crash was solved but I did not created a new release with it yet. Been busy since the last week.
Yes, so @SpyrosRoum opened a PR 6 hours ago that makes this possible, the #108, now we can detect "-" more easily. We will be able to have support for both ouch compress - output.tar.gz
ouch compress - - --format xz I just came up with Of course, would work without STDIN and STDOUT too: # Can be useful for some use cases
ouch compress file output_file --format xz It's still just an idea tho, should probably open an issue just dedicated to this one. |
Now, focusing on your current issue, I think that we should detect this with the flag The usage would be: ouch d hello.tar.lzma.zst --output -
ouch d hello.tar.lzma.zst -o - Using pipe: ouch d hello.tar.lzma.zst - | hexdump -C So We would change it's description from: Any thoughts on this? |
we should also move all current outputs to stderr, there are still a couple uses of |
I was going to use |
@figsoda great point, everything would need to go to It's a small tradeoff. |
we could also add compression to stdout after partial compression (#70 (comment)) is implemented, so imo all outputs should go to stderr, with possibly the exception of |
We could use |
are there any downsides of outputting to stderr? why do we need extra logic to switch the outputs |
For example someone may want to use it in a script and redirect errors to a log file. It would be impossible to do that if everything was outputted to stderrr. |
|
One could argue it's annoying because |
This is what I'm saying, a quite flag would be a better solution in my opinion if we don't want to add extra logic for checking if the output is being redirected |
Yeaah, I'm not a huge fan of that switch logic, so I think this is a moderate solution, will create the issue for it. |
in addition to a quiet flag, we can also use tracing with EnvFilter from tracing-subscriber |
Moving this specific part of the discussion to the dedicated issue #114. |
@figsoda @SpyrosRoum do you both think that If so, I can create it's dedicated issue. Motivations:
|
Yes, I also think it should probably replace |
To be clear, is that how it would look like? |
(disclaimer: It's just a suggestion for now, no issues open).
And for this decompression example, Trying to better explain the original idea, I thought of two cases where it might be useful: 1ouch compress archive.tar archive.tar.gz --format gz To compress 2Not being able to specify formats for STDOUT compression.
There is no
So |
stdout
Normally passing a dash when decompressing with other tools will cause the decompressor to output to stdout. There doesn't seem to be such support in ouch.
I also tried just compressing a single file as a ZSTD stream instead of tar'ing the file first and ouch crashed. #96 probably covers this issue.
The text was updated successfully, but these errors were encountered: