53 Commits

Author SHA1 Message Date
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
Vinícius Rodrigues Miguel
a9673a3eba Reuse Confirmation struct when checking for overwrite permission 2021-07-25 01:23:58 -03:00
Fabricio Dematte
dd6718bd3b chore: remove comments 2021-06-10 13:01:45 -03:00
João M. Bezerra
8eb973d470 Fixing --output flag missing in tests 2021-06-02 03:31:30 -03:00
Fabricio Dematte
38c88c1df2 more ouch cli testing 2021-05-31 08:22:10 -03:00
Fabricio Dematte
09e9036301 attempt to assert 2021-05-31 08:00:03 -03:00
João M. Bezerra
d1734b54cb Eliding some lifetimes 2021-05-28 03:14:03 -03:00
João M. Bezerra
f51a5c8727 Moving cli input .canonicalize to help testing
We are moving canonicalize_files step
    from parse_args_from
    to parse_args

This helps testing our CLI without panicking when files don't exist
2021-05-28 03:07:25 -03:00
João M. Bezerra
cd43f215ea Replace io::Error by reason: String - crate::Error
By removing io::Error from crate::Error, we can implement PartialEq in
the enum to make testing easier.
2021-05-28 02:15:12 -03:00
João M. Bezerra
57a3d231eb Turning oof subcrate into a module 2021-05-26 21:54:50 -03:00
João M. Bezerra
d01947d9e1 Adding rustfmt.toml and reformatting 2021-05-16 17:52:29 -03:00
João M. Bezerra
864fc1a29b decompression: panic if there are no arguments 2021-05-15 01:12:03 -03:00
Vinícius Miguel
3cb0bfa1e5 cli: refactor path canonicalizing logic 2021-04-09 02:05:31 -03:00
Vinícius Miguel
38e7009a27 cli: add an alias for the compress subcommand 2021-04-08 22:46:47 -03:00
Vinícius Miguel
c94b49f013 cli: Only suggest the typo correction and exit 2021-04-08 12:48:52 -03:00
Vinícius Miguel
2f6ac5e54c error: Save std::io::Error as a crate::Error variant 2021-04-08 00:26:02 -03:00
Vinícius Miguel
8a4ac5d6d1 cli: Check for typos on ouch compress 2021-04-07 00:26:53 -03:00
João M. Bezerra
e1c72a6a6b Removing unused cli::CommandInfo 2021-04-06 23:36:44 -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 Miguel
9b8dcb40fa cli: Canonicalize input files when decompressing 2021-04-06 04:12:00 -03:00
Vinícius Miguel
095ade6621 Code cleanup 2021-04-06 03:37:49 -03:00
Vinícius Rodrigues Miguel
011626f09b (WIP) Minor misc. changes 2021-04-05 02:57:46 -03:00
Vinícius Rodrigues Miguel
d2af261f67 Fix cargo test tests 2021-04-05 01:14:27 -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
0c9131c307 Start replacing clap with oof 2021-04-04 23:13:03 -03:00
Vinícius Rodrigues Miguel
b002de78d9 Show better error messages 2021-03-30 00:11:46 -03:00
Vinícius Rodrigues Miguel
2dc828c0ff (WIP) Showing better error messages 2021-03-29 23:11:22 -03:00
Vinícius R. Miguel
a96d26eba6 Bump to version 0.1.4 2021-03-29 02:58:16 -03:00
Vinícius Rodrigues Miguel
0f0b086943 Use the the -y and -n flags when decompressing .tar and .zip 2021-03-29 01:37:01 -03:00
Vinícius R. Miguel
c7cf1112b6 Add -y, --yes and -n, --no flags (currently unused) 2021-03-28 23:50:28 -03:00
Vinícius Rodrigues Miguel
19f12ff791 Ensure correct permissions for decompressed files from .zip on Unix 2021-03-26 22:39:23 -03:00
Vinícius Rodrigues Miguel
96a4e8bb78 Bump version to 0.1.3 2021-03-26 21:32:54 -03:00
João M. Bezerra
ce26246fd4 Changing the error imports 2021-03-26 14:03:06 -03:00
João M. Bezerra
755cc2a40d Refactoring and Clippy warnings 2021-03-25 20:50:42 -03:00
Vinícius Rodrigues Miguel
965041310c Make ouch support paths with dot-dot (..) for input files/directories 2021-03-25 03:20:20 -03:00
Vinícius Rodrigues Miguel
9ea18659e5 Update README, slightly reduce code repetition 2021-03-24 18:35:01 -03:00
Vinícius Rodrigues Miguel
6eee06a51a Bump app version 2021-03-24 17:51:59 -03:00
Vinícius Rodrigues Miguel
729dda819e Add support for Lzma decompression 2021-03-24 01:40:16 -03:00
Vinícius Rodrigues Miguel
22e131fb46 Add support for zip (and... .zip.zip) compression 2021-03-23 21:28:22 -03:00
Vinícius Rodrigues Miguel
2c0f2b380c Add Tar compression for in-memory buffers 2021-03-23 02:15:06 -03:00
Vinícius Rodrigues Miguel
9429fd8d67 Fix CLI parsing of decompression commands & early Compressor work 2021-03-22 23:39:08 -03:00
Vinícius Rodrigues Miguel
e08703850c Add support for decompressing .tar.{bz, xz, lz} and .zip.{bz, xz, lz} 2021-03-22 04:46:54 -03:00
Vinícius Rodrigues Miguel
77d7613967 WIP refactor 2021-03-22 03:44:56 -03:00
Vinícius Rodrigues Miguel
b6d4e50cca Early progress in supporting .tar files 2021-03-21 04:09:28 -03:00
Vinícius Rodrigues Miguel
155fca4526 refactor: New File struct and switch to use Extension 2021-03-21 00:53:54 -03:00
Vinícius Rodrigues Miguel
7fd6020d99 Add struct Extension 2021-03-20 18:58:26 -03:00
Vinícius Rodrigues Miguel
73398c2d50 tests: Add tests for extension extraction 2021-03-19 15:18:32 -03:00
Vinícius Rodrigues Miguel
65bc13e8fa tests: Start adding test for the command-line interface 2021-03-19 12:40:49 -03:00