summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMustaqim Malim <mustaqim@pm.me>2019-12-18 09:53:54 +0000
committerMarc Cornellà <marc.cornella@live.com>2019-12-18 10:53:53 +0100
commitad1169bf39d8cab3e0139299d8200dd18bdc2038 (patch)
treefb6f2d96082b876191e1ef71b88c8c58ffe6141f
parent1761685d3e8d0594ff580c968874665e64a9a9cb (diff)
downloadzsh-ad1169bf39d8cab3e0139299d8200dd18bdc2038.tar.gz
zsh-ad1169bf39d8cab3e0139299d8200dd18bdc2038.tar.bz2
zsh-ad1169bf39d8cab3e0139299d8200dd18bdc2038.zip
extract: add tar.lz support (#8479)
-rw-r--r--plugins/extract/README.md1
-rw-r--r--plugins/extract/_extract2
-rw-r--r--plugins/extract/extract.plugin.zsh1
3 files changed, 3 insertions, 1 deletions
diff --git a/plugins/extract/README.md b/plugins/extract/README.md
index aca300097..d6e4fa116 100644
--- a/plugins/extract/README.md
+++ b/plugins/extract/README.md
@@ -32,6 +32,7 @@ plugins=(... extract)
| `tar` | Tarball |
| `tar.bz2` | Tarball with bzip2 compression |
| `tar.gz` | Tarball with gzip compression |
+| `tar.lz` | Tarball with lzip compression |
| `tar.xz` | Tarball with lzma2 compression |
| `tar.zma` | Tarball with lzma compression |
| `tar.zst` | Tarball with zstd compression |
diff --git a/plugins/extract/_extract b/plugins/extract/_extract
index 47b918b29..e9d12d4d3 100644
--- a/plugins/extract/_extract
+++ b/plugins/extract/_extract
@@ -3,5 +3,5 @@
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
- "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
+ "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
&& return 0
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index b7d4e3ba7..5cc30d1ce 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -45,6 +45,7 @@ extract() {
&& tar --zstd -xvf "$1" \
|| zstdcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;;
+ (*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
(*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;;