summaryrefslogtreecommitdiff
path: root/plugins/extract/extract.plugin.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2020-01-02 15:46:19 -0500
committerTuowen Zhao <ztuowen@gmail.com>2020-01-02 15:46:19 -0500
commitff9208623b3573c736ae9118947aaf0c7e752998 (patch)
tree45977b00446155003d486c04c3b891a5b7c88441 /plugins/extract/extract.plugin.zsh
parent1456610ebd292625fdc34fa3167c9c0f67d85228 (diff)
parentca627655dbd1d110dbea34ec4a8c1964a1da83d2 (diff)
downloadzsh-ff9208623b3573c736ae9118947aaf0c7e752998.tar.gz
zsh-ff9208623b3573c736ae9118947aaf0c7e752998.tar.bz2
zsh-ff9208623b3573c736ae9118947aaf0c7e752998.zip
Merge branch 'master' of https://github.com/ohmyzsh/ohmyzsh
Diffstat (limited to 'plugins/extract/extract.plugin.zsh')
-rw-r--r--plugins/extract/extract.plugin.zsh8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index 27b9e50f1..349c9a776 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -40,10 +40,17 @@ extract() {
tar --lzma --help &> /dev/null \
&& tar --lzma -xvf "$1" \
|| lzcat "$1" | tar xvf - ;;
+ (*.tar.zst|*.tzst)
+ tar --zstd --help &> /dev/null \
+ && tar --zstd -xvf "$1" \
+ || zstdcat "$1" | tar xvf - ;;
(*.tar) 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" ;;
(*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;;
+ (*.lrz) (( $+commands[lrunzip] )) && lrunzip "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.z) uncompress "$1" ;;
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
@@ -59,6 +66,7 @@ extract() {
cd ..; rm *.tar.* debian-binary
cd ..
;;
+ (*.zst) unzstd "$1" ;;
(*)
echo "extract: '$1' cannot be extracted" >&2
success=1