69 Commits

Author SHA1 Message Date
tommady
1ff1932e3d
Merge folders in decompression (#798)
Signed-off-by: tommady <tommady@users.noreply.github.com>
2025-05-01 04:20:33 -03:00
Talison Fabio
c97bb6a2d6
feat: Add flag '--no-smart-unpack' to disable smart unpack (#809) 2025-04-28 11:03:50 -03:00
Talison Fabio
c584170a24
tweak: replace '.tmp-ouch-' prefix with 'tmp-ouch-' for smart unpack (#788) 2025-04-08 11:53:31 -03:00
Talison Fabio
c6cbf6e157 perf: replace .count() from iterators to more performative operations 2025-04-07 21:38:41 -03:00
Talison Fabio
3bf6aaa810 chore: improvements 2025-04-04 18:30:50 -03:00
Talison Fabio
081642724e cargo clippy 2025-04-04 18:30:50 -03:00
Talison Fabio
bb22cbb738 fix: check valid empty directory 2025-04-04 18:30:50 -03:00
Talison Fabio
3258cbef5b refactor: improve execute_decompression legibility 2025-04-04 18:30:50 -03:00
Talison Fabio
f65444d2fb feat: add conditional smart_unpack when --dir is provided 2025-04-04 18:30:50 -03:00
Talison Fabio
4f9a786e57 feat: add flag to check when use specify --dir 2025-04-04 18:30:50 -03:00
Talison Fabio
31dd9eb923
feat: Add rename option in overwrite menu (#779)
* feat: Add generic Choice prompt implementation

* feat: use ChoicePrompt in user_wants_to_continue method

* feat: add "rename" option in ask_to_create_file method

* feat: check accessible mode for choises prompt

* feat: rename file in "ask_to_create_file" rename action

* feat: create "resolve_path" for smart_unpack to deal with rename

* feat: use resolve_path instead clear_path in smart_unpack

* fix: remove unused clear_path function

* chore: cargo fmt

* Add docs

* refactor: rename "resolve_path" method

* chore: fix ChoicePrompt doc

* doc: improve doc of resolve_path_conflict

* fix: out of bound when type answer bigger than some choice

* doc: improve rename_path docs

* chore: cargo fmt

* chore: revert user_wants_to_continue

* fix: update error message when find EOF in choise prompt response

* revert: update message error in ChoicePrompt instead Confirmation

* test: add overwrite and cancel tests

* test: Add rename test with "allow_piped_choice" new feature

* cargo fmt

* test: create test for autoincrement new renamed files
2025-03-30 19:19:21 -03:00
Pascal Hertleif
ecc05cdd60 feat: Add support for Brotli
Using https://crates.io/crates/brotli/7.0.0

#203
2025-02-12 13:59:18 -03:00
ttyS3
353c360f6f style: cargo fmt with nightly version 2024-12-14 19:22:56 -03:00
ttyS3
62f3d78f44 refactor(decompress): refactor function to use DecompressOptions struct to make linter happy (too_many_arguments) 2024-12-14 19:22:56 -03:00
ttyS3
55aa05b631 feat(cli): add option to remove source file after decompression 2024-12-14 19:22:56 -03:00
João Marcos P. Bezerra
df6d2cea98 tweak: don't add period to end of each log 2024-11-18 00:32:17 -03:00
João Marcos P. Bezerra
e108e5b778 chore: improve message after moving file 2024-11-18 00:03:55 -03:00
João Marcos P. Bezerra
223f82d538 refac: simplify smart_unpack 2024-11-18 00:02:22 -03:00
João M. Bezerra
8edd8d2e1c Replace .unwrap()s by ? 2024-11-17 14:50:02 -03:00
Jonas Frei
ba9f9c00f3 Add support for bzip3
Closes #398
Signed-off-by: Jonas Frei <freijon@pm.me>
2024-11-17 14:50:02 -03:00
valoq
e2151c93d5 fix format to appease linter 2024-10-22 00:00:19 -03:00
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