48 Commits

Author SHA1 Message Date
valoq
83f28cf64a change temporary path to a more unique name 2024-10-22 00:00:19 -03:00
ttyS3
2dad11d0ba fix(password): update password handling for archives
Refactor password handling in archive functions to use &[u8] instead of impl AsRef<[u8]>. Include better error reporting for invalid UTF-8 passwords in 7z archives.
2024-09-06 21:47:03 -03:00
ttyS3
9b092fef71 style: cargo fmt 2024-09-06 21:47:03 -03:00
ttyS3
d21db763f1 feat: support decompress and list zip file 2024-09-06 21:47:03 -03:00
ttyS3
75e16510df feat(list): support list and decompress 7z files with password 2024-09-06 21:47:03 -03:00
ttyS3
512d2445b2 feat: add password support for decompress and list 2024-09-06 21:47:03 -03:00
Ryan Roden-Corrent
61f96cab13 Fix docstring formatting for clippy.
Fixes:

```
error: doc list item missing indentation
   --> src/commands/decompress.rs:237:5
    |
237 | /// Note: This functions assumes that `output_dir` exists
    |     ^
    |
    = help: if this is supposed to be its own paragraph, add a blank line
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
    = note: `-D clippy::doc-lazy-continuation` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::doc_lazy_continuation)]`
help: indent this line
    |
237 | ///   Note: This functions assumes that `output_dir` exists
    |     ++
```
2024-08-26 03:40:52 -03:00
Ryan Roden-Corrent
a7fe78fc68 Write decompressed stdin to stdin-output. 2024-08-26 03:40:52 -03:00
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
João Marcos P. Bezerra
28daa9e8c4 make logger channel static 2024-04-01 10:58:35 -03:00
João Marcos P. Bezerra
bed8ea0276 create Logger::info_accessible 2024-04-01 10:58:35 -03:00
Antonios Barotsis
1e56bb8f1f Improve logging interface 2024-04-01 10:58:35 -03:00
Antonios Barotsis
b04122a6de fix some errors + warnings 2024-04-01 10:58:35 -03:00
Antonios Barotsis
380893b6df Add levels and fix output 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
e989db7a3a Added buffering 2024-04-01 10:58:35 -03:00
Antonios Barotsis
c2873f77d3 wip 2024-04-01 10:58:35 -03:00
Antonios Barotsis
8e43cd2afa Change existing method docs to valid rustdoc 2024-02-28 20:27:32 -03:00
cyqsimon
fa2d214fee Feature-gate RAR support 2023-12-14 23:32:17 -03:00
Flat
69b1db4a35 chore: cargo fmt 2023-11-25 21:33:22 -03:00
Flat
97b4356aa8 feat: implement 7zip support for compression and decompression
This also fixes symlink canonicalization for Windows and fixes UI tests on Windows.
2023-11-25 21:33:22 -03:00
misilelab
db0bc8a7d9 impl except test 2023-11-25 21:33:22 -03:00
MisileLaboratory
d0d227b234 fix: Incorrect count 2023-11-25 21:33:22 -03:00
MisileLaboratory
30d269fc8f fix: Incorrect decompressed file count 2023-11-25 21:33:22 -03:00
MisileLaboratory
f2b984bc7a feat: cleanup codes and more error handling 2023-11-25 21:33:22 -03:00
MisileLaboratory
d825feaeff feat: good error output 2023-11-25 21:33:22 -03:00
MisileLaboratory
862181ae0a feat: decompress with count 2023-11-25 21:33:22 -03:00
MisileLaboratory
ceed0156a0 fix: now recursivly compress 7z 2023-11-25 21:33:22 -03:00
MisileLaboratory
3cb2367793 feat: simple impl 7zip and lot of todo 2023-11-25 21:33:22 -03:00
Łukasz Krawiec
dade163243 added support for listing and decompressing .rar archives 2023-11-15 08:59:00 -03:00
Pascal Seitz
c117517bbe switch to lz4_flex
The release of lz4_flex 0.11 fixes two issue that caused problems
before:
- The new `auto-finish` flushes on drop
- FrameEncoder writes now empty frames. Previously nothing was written,
  which caused issues with double compressed empty data.
2023-06-20 21:30:10 +08:00
Vinícius R. Miguel
3bb0e57ed4 Stop keeping track of the names of unpacked files 2023-01-05 15:52:21 -03:00
a-moreira
0ceb84d5cf better args order, fmt 2022-12-18 22:56:13 -03:00
a-moreira
e26323bd99 add cli option to (de)compress quietly 2022-12-18 22:49:37 -03:00
figsoda
13fab6d241 remove progress feature 2022-10-15 23:03:20 -04:00
João M. Bezerra
cdd1b530be fix not overwriting a folder when compressing 2022-10-15 21:36:24 -03:00
figsoda
51855948f1 add OutputLine trait for performance improvements 2022-10-13 11:31:43 -04:00
figsoda
8b0f4f3ee4 rewrite progress module 2022-10-12 20:49:33 -04:00
figsoda
5dc8d3efed fix: apply clippy lints 2022-10-03 20:56:48 -04:00
figsoda
a1c943923c refac: simplify smart_unpack to remove redundant code and make clippy happy 2022-08-14 12:24:41 +08:00
João M. Bezerra
278bc980c1 small changes and rewrite zip warning message 2022-06-04 14:36:57 -03: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
João M. Bezerra
f5fcf7f2a3 replace flat_map by flatten_compression_formats 2022-06-04 13:01:24 -03:00
João M. Bezerra
19769223c8 create helper function split_first_extension 2022-06-04 12:55:51 -03:00
João M. Bezerra
4d518b7056 small refactor and renamings 2022-06-04 12:47:17 -03:00
João M. Bezerra
c65959d648 break down commands.rs into multiple files 2022-06-04 11:46:23 -03:00