28 Commits

Author SHA1 Message Date
Talison Fabio
86386b2ef0 chore: fix ChoicePrompt doc 2025-03-22 22:48:45 -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
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
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
João Marcos P. Bezerra
a3e5bac438 fix STDIN syncrhonization problems 2024-04-01 10:58:35 -03:00
Antonios Barotsis
c2873f77d3 wip 2024-04-01 10:58:35 -03:00
figsoda
e06b2c8635 apply clippy suggestions 2023-01-05 14:23:37 -05:00
João M. Bezerra
c737956a4e check for EOF when asking questions
when invoking Ouch from shell scripts, it is likely that questions will
be left unanswered with EOF, this commit fixes Ouch interpreting EOF as
Yes in Y/N questions
2022-11-23 00:43:53 -03:00
João M. Bezerra
9f7cba79e1 use remove_file_or_dir to remove dir check 2022-10-15 22:31:47 -03:00
João M. Bezerra
cdd1b530be fix not overwriting a folder when compressing 2022-10-15 21:36:24 -03:00
João M. Bezerra
a2c91c4248 minor tweaks 2022-10-11 22:09:39 -03:00
João M. Bezerra
801189ec02 create is_running_in_accessible_mode helper
also renamed some variables
2022-06-04 21:38:16 -03: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
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
eac0a0687a fix clippy warnings 2022-06-04 10:59:51 -03:00
Vinícius Miguel
8b1cd18fb5
feat: don't allocate when possible in to_utf, nice_directory_display (#249) 2022-02-05 12:31:20 -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
Crypto-Spartan
17d9f17277 Ask user to continue after .zip warning is shown 2021-12-07 21:40:03 +00:00
Anton Hermann
40cee89bab Implement accessibility mode which reduces visual noise 2021-11-13 01:47:08 +01:00
João M. Bezerra
f09f1cecba Merging dialogs.rs with question.rs 2021-11-10 09:57:51 -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