32 Commits

Author SHA1 Message Date
Ryan Roden-Corrent
77c1a4e9db Support decompressing stdin.
Fixes #687.

If "-" is passed as a filename, decompress data from stdin.

Currently `--format` must be passed as well, but as a next step,
we could try to infer the format from magic numbers.

As stdin is not connected to the terminal, we cannot prompt for Y/N
when warning about decompression in memory, for e.g. zip. Just default
to No, and require passing "-y" in these cases.

For zip, we have to buffer the whole stream in memory to seek into it,
just as we do with a chained decoder like `.zip.bz`.

The rar format requires an actual file (not an `impl Read`), so
we write a temp file that it can decode.

When decoding a single-file archive (e.g. file.bz), the output filename
is just `-`, since we don't know the original filename. I had to add
a bit of a hack to the tests to work around this. Another option
would be to interpret "-d" as a destination filename in this case.

When decoding a multi-file archive, I decided to unpack directly into
the destination directory, as this seemed like a better experience than
adding a top-level "-" folder inside the destination.
2024-08-26 03:40:52 -03:00
João Marcos P. Bezerra
a3e5bac438 fix STDIN syncrhonization problems 2024-04-01 10:58:35 -03:00
Antonios Barotsis
1e56bb8f1f Improve logging interface 2024-04-01 10:58:35 -03:00
Antonios Barotsis
e2ac5c4c9b Make all info logs use the new system 2024-04-01 10:58:35 -03:00
Antonios Barotsis
c2873f77d3 wip 2024-04-01 10:58:35 -03:00
João Marcos
9507c4d93a
Merge pull request #502 from ouch-org/fix-size-unit-inconsistency
Fix size unit inconsistency
2023-09-07 16:12:20 -03:00
João M. Bezerra
c32cbd8c7b fix clippy warning 2023-09-04 21:49:42 -03:00
João M. Bezerra
cbd327aad7 replace usage of ubyte by our own Bytes formatter 2023-09-04 21:15:57 -03:00
Vinícius R. Miguel
2caeb1004c refac: add support for Windows in EscapedPathDisplay 2023-01-05 13:39:06 -03:00
Vinícius R. Miguel
0deb18289a refac: use BStr to display possibly non-UTF8 byte sequences 2023-01-05 12:46:29 -03:00
João M. Bezerra
e8d0914a01 improve error message when compressing folder with single-file formats 2022-10-17 00:03:44 -03:00
João M. Bezerra
2da497c1ca fix fatal error if read fails when compressing 2022-10-15 22:01:30 -03:00
João M. Bezerra
cdd1b530be fix not overwriting a folder when compressing 2022-10-15 21:36:24 -03:00
figsoda
2f4404e658 use humansize instead of Bytes 2022-10-12 22:33:41 -04:00
figsoda
996e597c1f fix: apply clippy lint 2022-08-14 12:32:54 +08:00
João M. Bezerra
97c4387fcf minor simplifications and renamings 2022-06-04 14:04:31 -03:00
João M. Bezerra
14025c6816 remove use_small_heuristics = "Max" from rustfmt
and update edition to 2021
2022-06-04 13:06:52 -03:00
Vinícius Miguel
336fc97831
feat: allow ignoring hidden files and files matched by .gitignore files (#245) 2022-01-16 23:30:26 -03:00
Crypto-Spartan
add6a595bd
Merge pull request #227 from Crypto-Spartan/question-continue
remove redundant user_wants_to_continue function
2021-12-09 18:21:32 -03:00
João Marcos Bezerra
9c3446924c
Merge pull request #224 from sigmaSd/sym
Ignore broken symlinks when compressing
2021-12-09 01:06:34 -03:00
Nbiba Bedis
734ffd4331 Compile on stable 2021-12-08 11:58:02 +01:00
João M. Bezerra
250d2e231c Reformat code 2021-12-07 23:25:21 -03:00
Crypto-Spartan
17d9f17277 Ask user to continue after .zip warning is shown 2021-12-07 21:40:03 +00:00
Spyros Roum
eb9a99fff3 Create util for clearing a path 2021-11-11 11:36:26 +02:00
João M. Bezerra
05d83a3726 Utf8 checks, using references and avoid allocating
And add docs
2021-11-10 19:59:36 -03:00
João M. Bezerra
f1c0c82323 Move utf8 utils from zip.rs to utils module 2021-11-10 19:47:36 -03:00
João M. Bezerra
b7c6589864 Small docs update 2021-11-10 10:09:54 -03:00
João M. Bezerra
a531d44e2b Move colors module to it's own file 2021-11-10 09:55:44 -03:00
João M. Bezerra
d27e259b26 Reorganizing src/utils, by renaming submodules
And moving formatting stuff out of fs.rs
2021-11-10 09:51:26 -03:00
João M. Bezerra
552096acf0 Minor import and module exporting changes 2021-11-10 06:03:46 -03:00
Nbiba Bedis
266cf6e27a Infer file extension when decompressing 2021-11-10 05:41:44 -03:00
Vinícius Miguel
739a52f00e
Refactor utils into a module (#166) 2021-11-05 22:04:00 -04:00