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
78b07e92
Commit
78b07e92
authored
Jan 05, 2020
by
Aloxaf
Committed by
Marc Cornellà
Jan 04, 2020
Browse files
extract: add lz4 support (#8510)
parent
ca627655
Changes
3
Hide whitespace changes
Inline
Side-by-side
plugins/extract/README.md
View file @
78b07e92
...
...
@@ -26,6 +26,7 @@ plugins=(... extract)
|
`ipsw`
| iOS firmware file |
|
`jar`
| Java Archive |
|
`lrz`
| LRZ archive |
|
`lz4`
| LZ4 archive |
|
`lzma`
| LZMA archive |
|
`rar`
| WinRAR archive |
|
`rpm`
| RPM package |
...
...
@@ -35,6 +36,7 @@ plugins=(... extract)
|
`tar.gz`
| Tarball with gzip compression |
|
`tar.lrz`
| Tarball with lrzip compression |
|
`tar.lz`
| Tarball with lzip compression |
|
`tar.lz4`
| Tarball with lz4 compression |
|
`tar.xz`
| Tarball with lzma2 compression |
|
`tar.zma`
| Tarball with lzma compression |
|
`tar.zst`
| Tarball with zstd compression |
...
...
plugins/extract/_extract
View file @
78b07e92
...
...
@@ -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|lrz|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|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|lrz|
lz4|
lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.
lz4|tar.
xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
&& return 0
plugins/extract/extract.plugin.zsh
View file @
78b07e92
...
...
@@ -46,11 +46,13 @@ extract() {
||
zstdcat
"
$1
"
|
tar
xvf -
;;
(
*
.tar
)
tar
xvf
"
$1
"
;;
(
*
.tar.lz
)
((
$+
commands[lzip]
))
&&
tar
xvf
"
$1
"
;;
(
*
.tar.lz4
)
lz4
-c
-d
"
$1
"
|
tar
xvf -
;;
(
*
.tar.lrz
)
((
$+
commands[lrzuntar]
))
&&
lrzuntar
"
$1
"
;;
(
*
.gz
)
((
$+
commands[pigz]
))
&&
pigz
-dk
"
$1
"
||
gunzip
-k
"
$1
"
;;
(
*
.bz2
)
bunzip2
"
$1
"
;;
(
*
.xz
)
unxz
"
$1
"
;;
(
*
.lrz
)
((
$+
commands[lrunzip]
))
&&
lrunzip
"
$1
"
;;
(
*
.lz4
)
lz4
-d
"
$1
"
;;
(
*
.lzma
)
unlzma
"
$1
"
;;
(
*
.z
)
uncompress
"
$1
"
;;
(
*
.zip|
*
.war|
*
.jar|
*
.sublime-package|
*
.ipsw|
*
.xpi|
*
.apk|
*
.aar|
*
.whl
)
unzip
"
$1
"
-d
$extract_dir
;;
...
...
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