157 Commits

Author SHA1 Message Date
João Marcos Bezerra
c89c34a91f
Fix single format compression (#89)
Now working for formats that are not archives, like file.gz and file.xz
2021-10-14 18:17:52 -03:00
Santo Cariotti
1c24f41494
chore: print format type instead of index (#84)
When it raises an error caused by position of the format, now prints
the format type as string instead of the position inside the array of
formats.
In this way you can read on stdout the type like `.tar` or `.lz` instead
of `1`, `2`, .., `n`.
2021-10-14 17:18:46 -03:00
figsoda
f923423a06
Extension: add support for tgz (#85)
* extension: add support for tgz
2021-10-14 16:55:34 -03:00
figsoda
cd461fa5a5
apply clippy lints and small refactors (#86) 2021-10-14 16:22:48 -03:00
Vinícius Miguel
14961bed65
Check if a folder is being compressed to a non-archive format (#79) 2021-10-07 17:09:33 -03:00
Vinícius Rodrigues Miguel
a739b5a482 Re-add "Compressing" output to Tar and make Tar and Zip compression use the info macro 2021-10-07 11:36:54 -03:00
Vinícius Rodrigues Miguel
d4862e2b6f test: check the resulting compressed files through MIME types 2021-10-06 23:54:20 -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
a6eaef1220 commands: replace usage of "bundle" by "archive" 2021-10-06 22:37:36 -03:00
Vinícius Rodrigues Miguel
b093277a85 Refactor FinalError::display_and_crash into Error::Custom 2021-10-06 16:23:19 -03:00
Vinícius Rodrigues Miguel
40410840c9 error: add MissingArgumentsForDecompression 2021-10-06 15:55:13 -03:00
Vinícius Rodrigues Miguel
990458b771 Release 0.2.0 2021-10-06 15:39:55 -03:00
Vinícius Miguel
a8beaaae84
Merge pull request #65 from ouch-org/buffers-capacity-improvement
Increasing read and writer buffers capacity
2021-10-06 01:07:28 -03:00
João M. Bezerra
5b54bf85ee Increasing read and writer buffers capacity
By changing from 8KB to 64KB we will be making 8 times less syscalls
2021-10-06 00:56:39 -03:00
Vinícius Rodrigues Miguel
e9bc65a787 Add support for Zstd 2021-10-05 23:56:09 -03:00
João M. Bezerra
3f718b8335 Simplify tests by making gen_args more generic 2021-10-05 22:21:11 -03:00
João Marcos Bezerra
4ddc21a551
Merge pull request #61 from GabrielSimonetto/issue-48
Make the "decompress" command explicit
2021-10-05 22:10:27 -03:00
Gabriel Simonetto
788809b8f3 Make decompress command explicit
- No subcommand given now calls the help menu
- Also added docs for the short version of compress and decompress
2021-10-05 22:06:18 -03:00
Vinícius Rodrigues Miguel
e7dd6f2d4f Don't use colors when stdout or stderr are being redirected 2021-10-05 21:12:15 -03:00
João M. Bezerra
f7139548f6 Switch from BTree to Hash collections 2021-10-05 18:10:28 -03:00
João M. Bezerra
2f5083278f Add libc dependency
Cross compatible (with windows) exit failure code
2021-10-03 00:20:12 -03:00
João M. Bezerra
89d1e6a752 Document modules 2021-10-03 00:17:57 -03:00
Gabriel Simonetto
e352f8bc93 Allow empty dirs on tar 2021-10-02 17:33:16 -03:00
Gabriel Simonetto
0c65fbd2d4 Allow empty dirs on zip 2021-10-02 17:14:16 -03:00
Vinícius Rodrigues Miguel
df062f4155 zip: optimize UTF-8 checks on Unix, remove unneeded Clone 2021-10-01 19:13:43 -03:00
Vinícius Rodrigues Miguel
17d8959a0f unix: if setting permission fails, return an error instead of panicking 2021-10-01 12:00:52 -03:00
Vinícius Rodrigues Miguel
8fc2f06ef7 error: remove unused error variants 2021-10-01 11:46:20 -03:00
Vinícius Rodrigues Miguel
6085807ddf cd_into_same_dir_as: allow the proper IO error to bubble up and add docs 2021-09-17 11:54:55 -03:00
Vinícius Rodrigues Miguel
8565e475c3 Rework FinalError::display into a FinalError::Display impl 2021-09-17 11:49:46 -03:00
Vinícius Rodrigues Miguel
130288beb4 dialogs: use Cow<str> to avoid cloning a String 2021-09-17 09:33:19 -03:00
Vinícius Rodrigues Miguel
a0f43b62f7 Release 0.1.6 2021-09-17 00:55:58 -03:00
Vinícius Rodrigues Miguel
b099e4ac20 Respect the NO_COLOR env. arg. 2021-09-17 00:55:38 -03:00
Vinícius Rodrigues Miguel
55aa65dcea Reduced repetition caused by [INFO] printing 2021-09-17 00:22:41 -03:00
Vinícius Rodrigues Miguel
c4a4792816 Misc cleanup 2021-09-16 23:14:00 -03:00
Vinícius Rodrigues Miguel
eabaac0145 Run rustfmt 2021-09-16 21:35:18 -03:00
João M. Bezerra
c9d4eea403 Minor renaming 2021-08-13 02:14:28 -03:00
João M. Bezerra
8f7f812e87 Removing unused macros 2021-08-04 12:41:32 -03:00
João M. Bezerra
33382d06c3 Adding more checks before compression 2021-08-04 12:05:41 -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
b969bda5a8 Added check for missing formats when decompressing 2021-08-03 19:12: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
51a88bebba Adding FinalError, using in crate::Error Display
Helps us add nice and consistently formatted error messages
2021-05-28 16:53:18 -03:00
João M. Bezerra
8707328944 Temporarly disabling platform-dependent test 2021-05-28 05:14:51 -03:00
João M. Bezerra
bf8ef70d16 Fixing Oof and Walkdir Error Display 2021-05-28 04:34:06 -03:00
João M. Bezerra
d1734b54cb Eliding some lifetimes 2021-05-28 03:14:03 -03:00