diff options
author | Marc Cornellà <hello@mcornella.com> | 2023-05-21 20:14:32 +0200 |
---|---|---|
committer | Marc Cornellà <hello@mcornella.com> | 2023-05-21 21:05:14 +0200 |
commit | b06663df23b2910a6e542dc114dc7adc2cdce22f (patch) | |
tree | f21d5f508b375a1d369eb34856f7e4c322ffca0d /plugins | |
parent | 3a01d7df82157a5f3aef01eab9a940e4cba2283a (diff) | |
download | zsh-b06663df23b2910a6e542dc114dc7adc2cdce22f.tar.gz zsh-b06663df23b2910a6e542dc114dc7adc2cdce22f.tar.bz2 zsh-b06663df23b2910a6e542dc114dc7adc2cdce22f.zip |
feat(extract): add support for `.zlib` and `.exe` files (#11085)
Fixes #11085
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/extract/README.md | 3 | ||||
-rw-r--r-- | plugins/extract/extract.plugin.zsh | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/plugins/extract/README.md b/plugins/extract/README.md index ac4a8e197..c8d98b229 100644 --- a/plugins/extract/README.md +++ b/plugins/extract/README.md @@ -25,6 +25,7 @@ plugins=(... extract) | `cpio` | Cpio archive | | `deb` | Debian package | | `ear` | Enterprise Application aRchive | +| `exe` | Windows executable file | | `gz` | Gzip file | | `ipa` | iOS app package | | `ipsw` | iOS firmware file | @@ -52,9 +53,11 @@ plugins=(... extract) | `txz` | Tarball with lzma2 compression | | `tzst` | Tarball with zstd compression | | `war` | Web Application archive (Java-based) | +| `whl` | Python wheel file | | `xpi` | Mozilla XPI module file | | `xz` | LZMA2 archive | | `zip` | Zip archive | +| `zlib` | zlib archive | | `zst` | Zstandard file (zstd) | | `zpaq` | Zpaq file | diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index ee1d38b3f..b7a823c9f 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -83,9 +83,10 @@ EOF builtin cd -q ../data; extract ../data.tar.* builtin cd -q ..; command rm *.tar.* debian-binary ;; (*.zst) unzstd "$full_path" ;; - (*.cab) cabextract "$full_path" ;; + (*.cab|*.exe) cabextract "$full_path" ;; (*.cpio|*.obscpio) cpio -idmvF "$full_path" ;; (*.zpaq) zpaq x "$full_path" ;; + (*.zlib) zlib-flate -uncompress < "$full_path" > "${file:r}" ;; (*) echo "extract: '$file' cannot be extracted" >&2 success=1 ;; |