mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-22 13:50:09 +00:00
extract: add lrz support (#8500)
This commit is contained in:
parent
b0be0439e5
commit
6bac9eb103
3 changed files with 5 additions and 1 deletions
|
@ -25,6 +25,7 @@ plugins=(... extract)
|
||||||
| `gz` | Gzip file |
|
| `gz` | Gzip file |
|
||||||
| `ipsw` | iOS firmware file |
|
| `ipsw` | iOS firmware file |
|
||||||
| `jar` | Java Archive |
|
| `jar` | Java Archive |
|
||||||
|
| `lrz` | LRZ archive |
|
||||||
| `lzma` | LZMA archive |
|
| `lzma` | LZMA archive |
|
||||||
| `rar` | WinRAR archive |
|
| `rar` | WinRAR archive |
|
||||||
| `rpm` | RPM package |
|
| `rpm` | RPM package |
|
||||||
|
@ -32,6 +33,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.lrz` | Tarball with lrzip compression |
|
||||||
| `tar.lz` | Tarball with lzip 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 |
|
||||||
|
|
|
@ -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.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|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)(-.)'" \
|
||||||
&& return 0
|
&& return 0
|
||||||
|
|
|
@ -46,9 +46,11 @@ extract() {
|
||||||
|| zstdcat "$1" | tar xvf - ;;
|
|| zstdcat "$1" | tar xvf - ;;
|
||||||
(*.tar) tar xvf "$1" ;;
|
(*.tar) tar xvf "$1" ;;
|
||||||
(*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
|
(*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
|
||||||
|
(*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$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" ;;
|
||||||
|
(*.lrz) (( $+commands[lrunzip] )) && lrunzip "$1" ;;
|
||||||
(*.lzma) unlzma "$1" ;;
|
(*.lzma) unlzma "$1" ;;
|
||||||
(*.z) uncompress "$1" ;;
|
(*.z) uncompress "$1" ;;
|
||||||
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
|
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
|
||||||
|
|
Loading…
Reference in a new issue