From 9d3ea0cece9e1f303a24f72560e5ceac8f2529c4 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sun, 23 Aug 2015 16:38:10 +0000 Subject: [PATCH] Better k decompression --- shells/zshrc | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/shells/zshrc b/shells/zshrc index 06af918..659cac4 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -228,18 +228,21 @@ function k(){ elif [ -f "$@" ] ; then #Extract if it's extractable case $1 in - *.tar.xz) pv $1|tar xJf -;; - *.tar.bz2) pv $1|tar xjf -;; - *.tar.gz) pv $1|tar xzf -;; - *.tar) pv $1|tar xf -;; - *.tbz2) pv $1|tar xjf -;; - *.tgz) pv $1|tar xzf -;; - *.bz2) bunzip2 $1 ;; - *.rar) rar x $1 ;; - *.gz) gunzip $1 ;; - *.zip) unzip $1 ;; - *.Z) uncompress $1 ;; - *.7z) 7z x $1 ;; + *.tar.xz) pv $1|tar -xJf - ;; + *.tar.bz2) pv $1|tar -xjf - ;; + *.tar.gz) pv $1|tar -xzf - ;; + *.tar) pv $1|tar -xf - ;; + *.tbz2) pv $1|tar -xjf - ;; + *.tgz) pv $1|tar -xzf - ;; + *.lzma) pv $1|tar --lzma -xf - ;; + *.xz) pv $1|tar -xJf - ;; + *.bz2) bunzip2 $1 ;; + *.rar) rar x $1 ;; + *.gz) gunzip $1 ;; + *.zip) unzip $1 ;; + *.Z) uncompress $1 ;; + *.7z) 7z x $1 ;; + *.lrz) lrzuntar $1 ;; *) vim $1 esac else