55 Commits

Author SHA1 Message Date
figsoda
2238a20f0f fix handling of unknown extensions 2023-01-31 10:57:07 -05:00
João M. Bezerra
73cff04eb5 make some extension items private 2023-01-10 04:35:24 -03:00
João M. Bezerra
752ed72a91 remove incorrect Display implementation 2023-01-10 04:35:03 -03:00
figsoda
5a3bac67c9 add --format option 2023-01-07 14:57:39 -05:00
figsoda
a9f2e614ed improve extension parsing logic 2023-01-02 22:15:00 -05:00
João M. Bezerra
f554e3c5f0 warn user if file extension is passed as file name
example: .tar.gz is a file named .tar with extension .gz

this can be confusing because people might expect .tar.gz to be a
.tar.gz archive, but it's currently not
2022-10-11 20:57:55 -03:00
Vinícius Miguel
99ec7d2cf2
Fix wrong filename suggestions when compressing folders into non-archives (#269) 2022-08-22 23:37:04 -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
figsoda
52a8acf2e1 support snappy format 2021-12-07 13:59:56 -05:00
Nbiba Bedis
0660c2fe59 Remove Lzip because its incorrect, and improve extention comparison 2021-11-13 09:46:08 +01:00
Vinícius Rodrigues Miguel
e81fafc3d3 Make Extension non-exhaustive 2021-11-03 18:08:39 -03:00
Vinícius Rodrigues Miguel
a798d20106 extension: Use hardcoded slices instead of Vecs when creating an Extension 2021-11-03 12:35:29 -03:00
figsoda
27d8e64192 minor improvements 2021-11-02 17:37:24 -04:00
figsoda
296826b4d3 add support for lz4 format 2021-11-02 17:37:24 -04:00
João M. Bezerra
d2d4a929e1 Docs improvements
+ Removed some dead code
2021-11-02 04:57:26 -03:00
João M. Bezerra
15e922b7ba Fixing some Extension tests 2021-11-02 01:16:42 -03:00
João Marcos Bezerra
75cad36c5c
Merge branch 'master' into Remove-tar-combinations-from-CompressionFormat 2021-11-02 01:00:18 -03:00
Spyros Roum
4921d3d3d2 Add Extension wrapper that lets us keep tgz instead of forcing tar.gz 2021-11-01 01:09:37 +02:00
Spyros Roum
604616e042 Use proper match with no wildcard when detecting if it's archive 2021-10-31 11:09:35 +02:00
João M. Bezerra
20e0067cad Adding docs in new files and functions 2021-10-31 03:21:52 -03:00
João Marcos Bezerra
95d38e99f6 Merge branch 'master' into issue-32 2021-10-31 03:01:41 -03:00
Gabriel Simonetto
7c82f2b3b7 Make remaining modules public in order to gain the documentation check 2021-10-30 17:00:07 -03:00
Spyros Roum
6b6ade8c9a Break down tgz, tbz, etc to tar + gz/bz 2021-10-22 14:49:32 +03:00
Spyros Roum
caca7901c4 Run cargo fmt 2021-10-22 14:47:44 +03:00
Spyros Roum
02657ee5bc Remove the variants from CompressionFormat 2021-10-22 14:46:54 +03:00
Spyros Roum
bdf5090844 zst is not an archive format.. 2021-10-22 02:21:31 +03:00
Spyros Roum
340827de1f Introduce is_archive_format method on CompressionFormat 2021-10-22 02:00:11 +03:00
Dominik Nakamura
06af320595
Add support for short tar archive extensions 2021-10-18 00:42:35 +09:00
figsoda
f923423a06
Extension: add support for tgz (#85)
* extension: add support for tgz
2021-10-14 16:55:34 -03:00
Vinícius Rodrigues Miguel
89271d465f extension: fix .bz2 being inferred to Gzip 2021-10-06 23:53:34 -03:00
Vinícius Rodrigues Miguel
e9bc65a787 Add support for Zstd 2021-10-05 23:56:09 -03:00
João M. Bezerra
89d1e6a752 Document modules 2021-10-03 00:17:57 -03:00
Vinícius Rodrigues Miguel
eabaac0145 Run rustfmt 2021-09-16 21:35:18 -03:00
João M. Bezerra
bb93e46535 Reworked compression
Now works with multiple formats, like
archive.zip.gz.lz.gz.gz2.xz

Now with minimum in-memory copying, compressing and decompressing (with
exception to .zip, due to the format limitations) is all done directly
into the final destination file.
2021-08-03 21:18:22 -03:00
João M. Bezerra
ac4948abf7 Decompression: multiple formats, no extra copying
Rewrote decompression to use chained decoders, creating a stream and
avoiding in-memory decompression, which caused redundant copying.

Now ouch supports any number of extensions as decompressing formats, not
only two.
2021-08-03 16:58:21 -03:00
João M. Bezerra
d01947d9e1 Adding rustfmt.toml and reformatting 2021-05-16 17:52:29 -03:00
João M. Bezerra
3869c2502e Moving bytes.rs implementation to utils.rs 2021-04-06 21:16:33 -03:00
João M. Bezerra
78d5f435ee Minor style changes 2021-04-06 20:14:33 -03:00
Vinícius Miguel
f9272b5ce5 evaluator: Verify if input files are decompressible 2021-04-06 04:30:36 -03:00
Vinícius R. Miguel
368a776b70 Add Bytes and impl Display for Bytes 2021-04-06 02:34:27 -03:00
Vinícius Rodrigues Miguel
1c5005f5a9 Adapt the Python test script to the new Ouch interface 2021-04-05 20:57:18 -03:00
João M. Bezerra
28901ec44e Binary size decreased by 35% (-400KB)
Huge refactor, removed totally `clap` to use our argparsing instead.
500+ modified.
2021-04-04 23:26:57 -03:00
João M. Bezerra
ce26246fd4 Changing the error imports 2021-03-26 14:03:06 -03:00
Vinícius Rodrigues Miguel
d99d8e71d3 Add a sad Python script for Ouch testing 2021-03-25 22:47:34 -03:00
Vinícius Rodrigues Miguel
bdc16fdb17 Add support for Bzip compression (includes .tar.bz2 and .zip.bz2 and etc) 2021-03-24 14:33:43 -03:00
Vinícius Rodrigues Miguel
9429fd8d67 Fix CLI parsing of decompression commands & early Compressor work 2021-03-22 23:39:08 -03:00