570 Commits

Author SHA1 Message Date
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
João M. Bezerra
fc8bc82296 separate function check_archive_formats_position 2023-02-03 02:24:07 -03:00
João M. Bezerra
54ee52610a fix rustdoc warnings 2023-02-03 02:24:07 -03:00
João M. Bezerra
6710987b38 move check_for_non_archive_formats to check.rs 2023-02-03 02:24:07 -03:00
João M. Bezerra
b938dc014c move build_archive_file_suggestion to extension.rs 2023-02-03 02:24:06 -03:00
João M. Bezerra
7f763ff500 move module tests to end of file 2023-02-03 01:19:34 -03:00
João M. Bezerra
aad55e6102 move check_mime_type to check.rs 2023-02-03 01:19:32 -03:00
João M. Bezerra
d2db26a59d create check.rs 2023-02-03 01:17:35 -03:00
João M. Bezerra
5b99f434c3 rename Opts to CliArgs 2023-02-03 01:17:33 -03:00
figsoda
58da7dbf34 always use zip64 2023-01-31 18:42:32 -05:00
figsoda
634978fea5
Merge branch 'main' into large 2023-01-31 18:08:24 -05:00
João Marcos
bc78e64739
Merge pull request #355 from figsoda/ext
fix handling of unknown extensions
2023-01-31 19:57:05 -03:00
figsoda
fe464213b3 fix typos 2023-01-31 14:21:19 -05:00
figsoda
2238a20f0f fix handling of unknown extensions 2023-01-31 10:57:07 -05:00
figsoda
50573f9d91 zip: fix compression of files larger than 4GB 2023-01-31 10:48:48 -05:00
figsoda
2d5dc06a4f multi-threaded snap compression using gzp 2023-01-30 19:36:20 -05:00
figsoda
5abdd5fc96 multi-threaded gzip compression using gzp 2023-01-30 19:36:20 -05:00
João Marcos Bezerra
4c53bde44d
Merge branch 'main' into remove-extension-display-implementation 2023-01-10 19:13:44 -03:00
João Marcos Bezerra
46731c0798
replace code that refers to .lz isntead of .lzma (#344) 2023-01-10 12:21:46 -03: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
f52254c91e refactor list command 2023-01-05 23:18:40 -05:00
Vinícius R. Miguel
23e33412a4 Decompress files in parallel 2023-01-05 21:22:38 -03:00
figsoda
c7165fb52c avoid directly indexing when possible 2023-01-05 15:10:22 -05:00
figsoda
e06b2c8635 apply clippy suggestions 2023-01-05 14:23:37 -05:00
Vinícius R. Miguel
3bb0e57ed4 Stop keeping track of the names of unpacked files 2023-01-05 15:52:21 -03:00
Vinícius R. Miguel
d99266e1ce Use ubyte instead of humansize 2023-01-05 14:49:46 -03:00
Vinícius R. Miguel
2caeb1004c refac: add support for Windows in EscapedPathDisplay 2023-01-05 13:39:06 -03:00
Vinícius R. Miguel
0deb18289a refac: use BStr to display possibly non-UTF8 byte sequences 2023-01-05 12:46:29 -03:00
Vinícius Miguel
9854285c38
listing: slight refactor when ensuring archive-only inputs (#331) 2023-01-05 02:37:18 -03:00
figsoda
a9f2e614ed improve extension parsing logic 2023-01-02 22:15:00 -05:00
João M. Bezerra
3f3ee9b87f accept inserting flags in any position 2022-12-24 03:18:41 -03:00
afm
71026287a3
flag: q instead of Q
Co-authored-by: João Marcos Bezerra <marcospb19@hotmail.com>
2022-12-18 23:32:12 -03:00
a-moreira
0ceb84d5cf better args order, fmt 2022-12-18 22:56:13 -03:00
a-moreira
e26323bd99 add cli option to (de)compress quietly 2022-12-18 22:49:37 -03:00
a-moreira
3e43f9d7e5 allow ouch to decompress archive into existing folder 2022-12-10 19:36:28 -03: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
figsoda
0ada885ced simplify logic 2022-10-17 09:20:13 -04:00
João M. Bezerra
e8d0914a01 improve error message when compressing folder with single-file formats 2022-10-17 00:03:44 -03:00
figsoda
13fab6d241 remove progress feature 2022-10-15 23:03:20 -04:00
figsoda
f610ff596b
Merge pull request #297 from ouch-org/fix-fatal-error-if-read-fails-when-compressing
Fix fatal error if read fails when compressing
2022-10-15 22:38:12 -04: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
a29ff3c637 fix error message when compressing zip archive 2022-10-15 22:22:52 -03:00
João M. Bezerra
6e6796bf4e fix clippy warnings 2022-10-15 22:19:30 -03:00
João M. Bezerra
70bdfc4e99 improve fatal error message 2022-10-15 22:06:40 -03:00
João M. Bezerra
2da497c1ca fix fatal error if read fails when compressing 2022-10-15 22:01:30 -03:00
João M. Bezerra
4d2ccf4873 create remove_file_or_dir util 2022-10-15 21:51:52 -03:00
João M. Bezerra
f5fc7bd755 improve documentation of compress_files 2022-10-15 21:51:29 -03:00
João M. Bezerra
cdd1b530be fix not overwriting a folder when compressing 2022-10-15 21:36:24 -03:00
figsoda
afdbf178ed fix infinite compression if output file is inside the input folder 2022-10-13 21:05:15 -04:00
João M. Bezerra
3d29e17060 remove automatic detection for partial compression 2022-10-13 18:53:29 -03:00
figsoda
889f1d9c35 fix typo 2022-10-13 11:51:48 -04:00
figsoda
d4766c4bf3
Merge branch 'main' into rewrite-progress 2022-10-13 11:37:09 -04:00
figsoda
51855948f1 add OutputLine trait for performance improvements 2022-10-13 11:31:43 -04:00
figsoda
dd6ab2aa6e rename out to log_out 2022-10-13 10:27:04 -04:00
figsoda
2f4404e658 use humansize instead of Bytes 2022-10-12 22:33:41 -04:00
figsoda
8b0f4f3ee4 rewrite progress module 2022-10-12 20:49:33 -04:00
figsoda
09d390608f set last modified time during zip compression 2022-10-11 22:01:13 -04:00
João M. Bezerra
a2c91c4248 minor tweaks 2022-10-11 22:09:39 -03:00
João M. Bezerra
71893aafeb Refactor the way we set last modified times
Last modified time is a piece of metadata that is available when
decompressing an archive
2022-10-11 22:09:39 -03:00
João Marcos Bezerra
e12c25e833
Merge pull request #277 from ouch-org/wann-file-extension-passed-as-file-name
Warn user if file extension is passed as file name
2022-10-11 21:19:02 -03: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
João Marcos Bezerra
cd21ee99b8
Merge pull request #276 from figsoda/update-deps
bump dependencies
2022-10-11 17:41:45 -03:00
figsoda
dfb3a367e4 bump dependencies 2022-10-11 16:27:27 -04:00
João M. Bezerra
22697737cd show aliases on --help 2022-10-11 17:19:08 -03:00
figsoda
5dc8d3efed fix: apply clippy lints 2022-10-03 20:56:48 -04:00
figsoda
5d27a0cd0b feat: generate man pages with clap_mangen 2022-10-03 20:56:48 -04:00
João Marcos Bezerra
398a619018
Merge pull request #271 from figsoda/zip-permissions
fix: respect file permissions when compressing zip files
2022-09-16 18:46:57 -03:00
figsoda
0519b5663e fix: respect file permissions when compressing zip files 2022-09-01 16:17:29 -04:00
figsoda
1f8cbdd360 fix: incorrect warnings for decompression 2022-09-01 14:27:12 -04:00
Vinícius Miguel
99ec7d2cf2
Fix wrong filename suggestions when compressing folders into non-archives (#269) 2022-08-22 23:37:04 -03:00
figsoda
996e597c1f fix: apply clippy lint 2022-08-14 12:32:54 +08:00
figsoda
a1c943923c refac: simplify smart_unpack to remove redundant code and make clippy happy 2022-08-14 12:24:41 +08:00
João M. Bezerra
86234084ab refac: use Lazy cell to optimize env::current_dir call 2022-08-12 13:03:48 -03:00
Dan Martinez
39ea378cc5 Fix the decompress -d argument description 2022-08-11 14:29:23 -07:00
João M. Bezerra
7ed3a16f21 chore: update rustfmt config
remove 'force_multiline_blocks' config
2022-07-04 11:06:16 -03:00
João M. Bezerra
2e165e57cb fix rustdoc lint warnings 2022-06-05 12:52:20 -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
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
João M. Bezerra
8bd78f49cd fix accessible warning if reversed 2022-06-04 11:46:59 -03:00
João M. Bezerra
c65959d648 break down commands.rs into multiple files 2022-06-04 11:46:23 -03:00
João M. Bezerra
eac0a0687a fix clippy warnings 2022-06-04 10:59:51 -03:00
Artturin
2b53db9bdd fix clippy warning
https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
2022-06-01 17:40:57 +03:00
João Marcos Bezerra
45a456f127
Merge branch 'master' into fix-zip-warning 2022-03-02 20:32:45 -03:00
Jan Christian Grünhage
abca371dcc fix: remove single quotes from clap doc comments
Apparently, clap_complete doesn't properly escape single quotes in doc
comments, leading to broken shell completions for zsh. To circumvent
this, I've removed the single quote in the one place where it shouldn't
have been in the first place ("it's" vs "its", contraction vs possessive
pronoun), and replaced "it's" with "it is" in the other place.

Reference to upstream issue: https://github.com/clap-rs/clap/issues/1596
2022-02-13 10:36:06 +01:00
Vinícius R. Miguel
7dd016aa54 feat: recover last modified time when unpacking zip archives 2022-02-05 23:08:21 -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
João M. Bezerra
26138e0f06 Reuse zip warning message 2022-02-03 18:00:02 -03:00
João Marcos Bezerra
1a1449a569
Merge branch 'master' into fix-zip-warning 2022-02-03 16:12:14 -03:00
João M. Bezerra
923a0601eb Update compress_files docs 2022-02-03 16:02:48 -03:00
Vinícius Miguel
336fc97831
feat: allow ignoring hidden files and files matched by .gitignore files (#245) 2022-01-16 23:30:26 -03:00
João Marcos Bezerra
7a7c6b64fb
Merge pull request #240 from Crypto-Spartan/update-clap-3.0.4
Update clap to v3.0.4
2022-01-16 22:44:20 -03:00
Vinícius Miguel
bf9e6b7b98
feat: use Cow<'static, str> in FinalError (#246) 2022-01-16 18:35:53 -03:00
Vinícius Miguel
6fc6d23872
fix: missing #[must_use] attribute on a method returning Self (#243) 2022-01-15 16:14:23 -03:00
Crypto-Spartan
56f11424dc
remove lib.rs and move contents to main.rs (#241) 2022-01-13 15:13:12 -03:00
Crypto-Spartan
8ae774ceff add 'about' info (Cargo.toml descripion value) to help message 2022-01-05 21:55:26 +00:00
Crypto-Spartan
e816ec1f8f use rustfmt 2022-01-04 23:01:32 +00:00
Crypto-Spartan
fa2af20814 fix warning for zip with additional formats 2022-01-04 22:45:24 +00:00
Lovecraftian Horror
0b688fa70c Make yes, no, and accessible flags global 2021-12-29 14:15:30 -06:00
João Marcos Bezerra
308b8f7e90
Merge pull request #225 from sigmaSd/list
List command: print file immediatly after it is processed
2021-12-20 13:11:15 -03:00
Nbiba Bedis
3ce9927e2b Show progress when using list --tree 2021-12-20 11:22:52 +01:00
Nbiba Bedis
40bb56bf79 Mark files as directories when compressing to zip regardless if they're empty or not 2021-12-14 09:18:16 +01:00
João Marcos Bezerra
35a158ec63
Merge pull request #229 from sigmaSd/ux
Actually use relative paths when extracting
2021-12-13 22:43:14 -03:00
sigmaSd
a3d3e5d1d9
Truncate long messages in the progress bar (#214)
* Truncate long messages in the progress bar
2021-12-13 22:40:52 -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
João Marcos Bezerra
f40f40cda0
Merge pull request #226 from Crypto-Spartan/eprint-fix
simple eprintln fixes
2021-12-09 17:53:13 -03:00
Nbiba Bedis
42bcc024d4 Actually use relative paths when extracting 2021-12-09 17:59:25 +01:00
Nbiba Bedis
19081caa70 Rebase 2021-12-09 09:37:23 +01:00
Nbiba Bedis
47462ba40d Rebase 2021-12-09 09:34:07 +01:00