Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
ad1169bf
Commit
ad1169bf
authored
Dec 18, 2019
by
Mustaqim Malim
Committed by
Marc Cornellà
Dec 18, 2019
Browse files
extract: add tar.lz support (#8479)
parent
1761685d
Changes
3
Hide whitespace changes
Inline
Side-by-side
plugins/extract/README.md
View file @
ad1169bf
...
@@ -32,6 +32,7 @@ plugins=(... extract)
...
@@ -32,6 +32,7 @@ plugins=(... extract)
|
`tar`
| Tarball |
|
`tar`
| Tarball |
|
`tar.bz2`
| Tarball with bzip2 compression |
|
`tar.bz2`
| Tarball with bzip2 compression |
|
`tar.gz`
| Tarball with gzip compression |
|
`tar.gz`
| Tarball with gzip compression |
|
`tar.lz`
| Tarball with lzip compression |
|
`tar.xz`
| Tarball with lzma2 compression |
|
`tar.xz`
| Tarball with lzma2 compression |
|
`tar.zma`
| Tarball with lzma compression |
|
`tar.zma`
| Tarball with lzma compression |
|
`tar.zst`
| Tarball with zstd compression |
|
`tar.zst`
| Tarball with zstd compression |
...
...
plugins/extract/_extract
View file @
ad1169bf
...
@@ -3,5 +3,5 @@
...
@@ -3,5 +3,5 @@
_arguments \
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
'(-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
&& return 0
plugins/extract/extract.plugin.zsh
View file @
ad1169bf
...
@@ -45,6 +45,7 @@ extract() {
...
@@ -45,6 +45,7 @@ extract() {
&&
tar
--zstd
-xvf
"
$1
"
\
&&
tar
--zstd
-xvf
"
$1
"
\
||
zstdcat
"
$1
"
|
tar
xvf -
;;
||
zstdcat
"
$1
"
|
tar
xvf -
;;
(
*
.tar
)
tar
xvf
"
$1
"
;;
(
*
.tar
)
tar
xvf
"
$1
"
;;
(
*
.tar.lz
)
((
$+
commands[lzip]
))
&&
tar
xvf
"
$1
"
;;
(
*
.gz
)
((
$+
commands[pigz]
))
&&
pigz
-dk
"
$1
"
||
gunzip
-k
"
$1
"
;;
(
*
.gz
)
((
$+
commands[pigz]
))
&&
pigz
-dk
"
$1
"
||
gunzip
-k
"
$1
"
;;
(
*
.bz2
)
bunzip2
"
$1
"
;;
(
*
.bz2
)
bunzip2
"
$1
"
;;
(
*
.xz
)
unxz
"
$1
"
;;
(
*
.xz
)
unxz
"
$1
"
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment