584 Commits

Author SHA1 Message Date
ttyS3
61868dfb56 fix: remove unnecessary clones in zip decryption 2024-09-06 21:47:03 -03:00
ttyS3
309d165606 fix(archive): replace unwrap with error handling in zip.rs 2024-09-06 21:47:03 -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
8987992c21 chore: fix tests 2024-09-06 21:47:03 -03:00
ttyS3
3392730d66 style: lint the code 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
nalabrie
3867fa33e9 adjust README to indicate zstd runs in parallel, remove leftover code comment 2024-07-27 01:07:23 -03:00
nalabrie
0ec7d4489d Added multithreading by default to zstd compression. Bumped zstd package version. Added num_cpus package to get core count. 2024-07-27 01:07:23 -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
62d70225ab remove macros.rs module 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
c56978d1e7 handle logger thread in main function 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
39395c797a move code to function run_cmd 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
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
93752d5fb5 fmt 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
João Marcos P. Bezerra
6f566b9c4d add module docs for accessible mode 2024-03-15 15:26:55 -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
João Marcos P. Bezerra
4314a3bbdd Mention Rar support in README and help 2023-12-05 13:04:08 -03:00
Ilya Grigoriev
e2796cef78 Mention 7z support in README and help 2023-12-05 13:04:08 -03:00
Ilya Grigoriev
9f82c9a655 Clarify that .sz refers to Google's Snappy format
It needs to be disambiguated from the unfortunately named
SZ compression, see https://szcompressor.org/.

Fixes #563
2023-12-05 13:04:08 -03:00
João Marcos P. Bezerra
a7a65d2510 Report errors for non-UTF-8 entries in Zip and 7z 2023-11-25 21:33:22 -03:00
João Marcos P. Bezerra
d07c65508a Removing redundant code 2023-11-25 21:33:22 -03:00
João Marcos P. Bezerra
8483739184 Minor refactor to archive handling code 2023-11-25 21:33:22 -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
9a6d73bf57 idk i just merged and patch some
Signed-off-by: MisileLab <misileminecord@gmail.com>
2023-11-25 21:33:22 -03:00
figsoda
8023a9157e small cleanups 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
2ebdaf6ecf feat: RefCell remove 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
76a459e02e feat: good 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
9e6a9cf40b [ci skip] not ready 2023-11-25 21:33:22 -03:00
MisileLaboratory
d4581090d8 style: cargo fmt 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
Łukasz Krawiec
a3dca85cdd fixed check_mime_type usage 2023-11-15 08:59:00 -03:00
figsoda
b7da9b02ac
Merge pull request #509 from ouch-org/fix-unaligned-messages
fix unaligned output when using parallelism
2023-09-19 22:42:39 -04:00
João M. Bezerra
a26d3d34ce Improve hints when decompressing with no extension
refactored `check_missing_formats_when_decompressing` to be aware of
missing extensions and unsupported extensions in order to give a more
detailed error message
2023-09-17 20:05:54 -03:00
João M. Bezerra
c7f69194e8 give a less ambiguous warning for sniff failure
Ouch check for file signatures to be sure that the file indeed has the
correct format as inferred by extension, when that fails, we output a
message explaining that Ouch wasn't able to confirm the format, however,
previous message was confusing with the other extension detection ones
2023-09-17 19:06:14 -03:00
figsoda
4703f1b821
Merge pull request #511 from ouch-org/cli-add-tests
add tests for CLI usage
2023-09-16 10:16:39 -04:00
João M. Bezerra
c7d48297fc add tests for CLI usage 2023-09-15 18:24:06 -03:00
João M. Bezerra
10d530d236 fix unaligned output when using parallelism 2023-09-12 14:00:19 -03:00
João M. Bezerra
7c6989de0e completions: hint generator to expand to file paths 2023-09-12 13:20:24 -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
João M. Bezerra
76116ed5ec re-add our size unit code from 368a776 2023-09-04 20:40: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
João M. Bezerra
20f38390c6 fix: handle Zip when modified times are missing 2023-06-04 17:19:23 -03:00
João M. Bezerra
d926e0f00a minor, use Try 2023-04-16 22:58:03 -03:00
figsoda
8d77478b73 increase compression level of --fast from 0 to 1 2023-03-19 15:33:10 -04:00
figsoda
499e2ea5fd extract level to a variable 2023-03-19 15:32:54 -04:00
figsoda
f21883170b implement --fast and --slow 2023-03-19 15:04:27 -04:00
xgdgsc
abc3bfe3a4 clippy fix 2023-03-19 09:41:39 +08:00
xgdgsc
994a9b384d
Update src/commands/compress.rs
Co-authored-by: figsoda <figsoda@pm.me>
2023-03-19 09:17:42 +08:00
xgdgsc
e92b9ff723 option level tests 2023-03-18 12:23:59 +08:00
xgdgsc
b8b9c5042f 🐛 fix 2023-03-18 08:54:15 +08:00
xgdgsc
653ff976f5 clamp , merge test 2023-03-17 22:09:20 +08:00
xgdgsc
d9ffd42c8f 🐛 fix 2023-03-17 21:36:31 +08:00
xgdgsc
ffa16c7d6e add test, move 2023-03-17 17:59:53 +08:00
xgdgsc
df5f846581 🔥 name 2023-03-15 21:41:59 +08:00
xgdgsc
2c917dfa29 add raw level arg 2023-03-14 20:07:16 +08:00
figsoda
40b0b7b364 fix deprecation warning 2023-03-11 16:33:42 -05:00
figsoda
732159b662
fixup outdated comment for check_mime_type 2023-02-06 21:13:06 -05:00
João M. Bezerra
8102260da4 simplify check_mime_type 2023-02-06 20:56:46 -03:00
figsoda
045ed5d72e make mime sniffing consistent for list and decompress 2023-02-06 12:59:16 -05:00
Orhun Parmaksız
a2c894d935
Merge branch 'main' into feat/add_ls_alias 2023-02-05 00:54:20 +03:00
Orhun Parmaksız
c88d121ecc
Add ls as an alternative alias for listing 2023-02-05 00:17:36 +03:00
João M. Bezerra
99d9c09fb7 refac: check_invalid_compression_with_non_archive_format 2023-02-03 02:24:07 -03:00
João M. Bezerra
1f4eba2bcb separate function check_invalid_compression_with_non_archive_format 2023-02-03 02:24:07 -03:00
João M. Bezerra
93daa7b929 separate function check_first_format_when_compressing 2023-02-03 02:24:07 -03:00
João M. Bezerra
f33c9c0f39 separate function check_missing_formats_when_decompressing 2023-02-03 02:24:07 -03:00
João M. Bezerra
db62f1c534 --help: add .sz to list of supported formats 2023-02-03 02:24:07 -03:00
João M. Bezerra
3748e1d31e add #![warn(missing_docs)] to check.rs 2023-02-03 02:24:07 -03:00