110 Commits

Author SHA1 Message Date
Talison Fabio
e2e28b008f chore: cargo fmt 2025-03-23 11:39:57 -03:00
Talison Fabio
f916f4d419 doc: improve rename_path docs 2025-03-23 11:34:16 -03:00
Talison Fabio
af61cb0bc2 fix: out of bound when type answer bigger than some choice 2025-03-23 11:33:45 -03:00
Talison Fabio
2a0b70f2bd doc: improve doc of resolve_path_conflict 2025-03-22 23:27:55 -03:00
Talison Fabio
86386b2ef0 chore: fix ChoicePrompt doc 2025-03-22 22:48:45 -03:00
Talison Fabio
022e9f0883 refactor: rename "resolve_path" method 2025-03-22 22:46:26 -03:00
Talison Fabio
cede4b2624 Add docs 2025-03-22 22:46:02 -03:00
Talison Fabio
3626e7196f chore: cargo fmt 2025-03-22 22:34:00 -03:00
Talison Fabio
782cd27580 fix: remove unused clear_path function 2025-03-22 20:24:16 -03:00
Talison Fabio
77d999d33a feat: use resolve_path instead clear_path in smart_unpack 2025-03-22 20:22:01 -03:00
Talison Fabio
8b84038cec feat: create "resolve_path" for smart_unpack to deal with rename 2025-03-22 20:21:23 -03:00
Talison Fabio
63e8549408 feat: rename file in "ask_to_create_file" rename action 2025-03-22 20:18:27 -03:00
Talison Fabio
609bddaa18 feat: check accessible mode for choises prompt 2025-03-22 20:16:01 -03:00
Talison Fabio
8b7b25d748 feat: add "rename" option in ask_to_create_file method 2025-03-18 17:47:36 -03:00
Talison Fabio
8a8e44abe7 feat: use ChoicePrompt in user_wants_to_continue method 2025-03-18 17:41:39 -03:00
Talison Fabio
98ca77f953 feat: Add generic Choice prompt implementation 2025-03-18 17:36:35 -03:00
ttyS3
e1d7f1424a refactor: improve code formatting in mod.rs and logger.rs 2024-12-14 19:52:32 -03:00
ttyS3
77b01d170f refactor(cli): move thread pool setup to command execution, use thread::spawn instead of rayon::spawn in the logger thread 2024-12-14 19:52:32 -03:00
ttyS3
22d4e0faf0 chore: add comments about RAR 4.x and 5.0 signature 2024-12-02 12:34:48 -03:00
João Marcos P. Bezerra
3e890eb307 chore: rename functions and fix wrong logs 2024-11-20 03:32:20 -03:00
João Marcos P. Bezerra
cc530bea94 refac: simplify logger shutdown system 2024-11-20 03:32:20 -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
60d5897de1 fix: don't shutdown logger after flush 2024-11-17 23:52:39 -03:00
João Marcos P. Bezerra
065124cd30 tweak: improve error message
in case the user is trying to decompress a file with no filestem, just
the extension, which is confusing
2024-11-17 23:49:18 -03:00
João Marcos P. Bezerra
5b78b96fa1 fix: warnings not shown before stdin interaction 2024-11-17 23:47:11 -03:00
João Marcos P. Bezerra
639ef19fbc chore: simplify code after feature stabilization
no need to reimplement `Path::is_symlink` anymore
2024-11-17 21:21:58 -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
João M. Bezerra
5dac8431f2 Fix --format parsing extensions with dots
Also improve error reporting for `--format` with malformed or
unsupported extensions

This commit is very messy, as it also does an refac in the project,
which should ideally be in a separated commit
2024-09-07 00:24:50 -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
Antonios Barotsis
a14bbfc904 Switched to explicit shutdown message instead of None 2024-04-01 10:58:35 -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
ccbdceac34 logger: fix warning output 2024-04-01 10:58:35 -03:00
João Marcos P. Bezerra
615a7d3c49 logger: flush logs temporarily 2024-04-01 10:58:35 -03:00
João Marcos P. Bezerra
25d7d3d870 logger: refactor usage of sync primitives
use `std::sync::Barrier` instead of the barebones `Condvar` + `Mutex`
combo
2024-04-01 10:58:35 -03:00
João Marcos P. Bezerra
792db000bb move spawn_logger_thread to logger module
and create another module inside of the logger module to reorganize
things
2024-04-01 10:58:35 -03:00
João Marcos P. Bezerra
0b760aadf7 fix logger thread shutdown system 2024-04-01 10:58:35 -03:00
João Marcos P. Bezerra
d0280f0579 move code to function spawn_logger_thread 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
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
misilelab
db0bc8a7d9 impl except test 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
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
João M. Bezerra
693167e933 formatting: fix gibibytes vs gigabytes issue 2023-09-04 20:54:49 -03:00