ad1169bf39d8cab3e0139299d8200dd18bdc2038

Author
Mustaqim Malim <mustaqim@pm.me>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

extract: add tar.lz support (#8479)

Diff

 1diff --git a/plugins/extract/README.md b/plugins/extract/README.md
 2index aca30009719c861cdfa19a254379b3582717bd9a..d6e4fa11653873c274b39c2538a995beed779cbf 100644
 3--- a/plugins/extract/README.md
 4+++ b/plugins/extract/README.md
 5@@ -32,6 +32,7 @@ plugins=(... extract)
 6 | `tar`             | Tarball                              |
 7 | `tar.bz2`         | Tarball with bzip2 compression       |
 8 | `tar.gz`          | Tarball with gzip compression        |
 9+| `tar.lz`          | Tarball with lzip compression        |
10 | `tar.xz`          | Tarball with lzma2 compression       |
11 | `tar.zma`         | Tarball with lzma compression        |
12 | `tar.zst`         | Tarball with zstd compression        |
13diff --git a/plugins/extract/_extract b/plugins/extract/_extract
14index 47b918b29b952fc56852539c8d46b64ef71f4cb8..e9d12d4d3cc00fbcee27d8eda1f0f5271da00c84 100644
15--- a/plugins/extract/_extract
16+++ b/plugins/extract/_extract
17@@ -3,5 +3,5 @@
18 
19 _arguments \
20   '(-r --remove)'{-r,--remove}'[Remove archive.]' \
21-  "*::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)(-.)'" \
22+  "*::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)(-.)'" \
23     && return 0
24diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
25index b7d4e3ba7e3fdc27d07f02bc3fe12bda474544e5..5cc30d1ce0697ae34d1f6e932bc954f223ee0a4a 100644
26--- a/plugins/extract/extract.plugin.zsh
27+++ b/plugins/extract/extract.plugin.zsh
28@@ -45,6 +45,7 @@ extract() {
29 				&& tar --zstd -xvf "$1" \
30 				|| zstdcat "$1" | tar xvf - ;;
31 			(*.tar) tar xvf "$1" ;;
32+			(*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
33 			(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
34 			(*.bz2) bunzip2 "$1" ;;
35 			(*.xz) unxz "$1" ;;