local x super
for x in "$@"; do
case "$x" in
+ # tars first, so they are higher pri than non-tar extensions
+ *.tar ) tar xf "$x" ;;
+ *.tar.bz2 | *.tbz2 ) tar xjf "$x" ;;
+ *.tar.gz | *.tgz ) tar xzf "$x" ;;
+ *.tar.xz ) tar Jxf "$x" ;;
+ *.xz) xz -d "$x" ;;
*.7z ) 7za x "$x" ;;
*.bz2 ) bunzip2 "$x" ;;
*.deb ) ar x "$x" ;;
*.r[0-9][0-9]|*.rar ) unrar x "$x" ;;
*.rpm ) rpm2cpio "$x" | cpio --extract --make-directories ;;
*.sfs) $super unsquashfs "$x" ;;
- *.tar ) tar xf "$x" ;;
- *.tar.bz2 | *.tbz2 ) tar xjf "$x" ;;
- *.tar.gz | *.tgz ) tar xzf "$x" ;;
- *.tar.xz ) tar Jxf "$x" ;;
- *.xz) xz -d "$x" ;;
*.Z ) uncompress "$x" ;;
*.zip|*.xpi ) unzip "$x" ;;