Browse Source

archive: add support for *.jar files (#1302)

master
Khai Do 8 years ago committed by Kaleb Elwert
parent
commit
7242b4ed49
  1. 2
      modules/archive/README.md
  2. 2
      modules/archive/functions/_lsarchive
  3. 2
      modules/archive/functions/_unarchive
  4. 2
      modules/archive/functions/lsarchive
  5. 2
      modules/archive/functions/unarchive

2
modules/archive/README.md

@ -25,7 +25,7 @@ installed:
- *.xz* requires `unxz`. - *.xz* requires `unxz`.
- *.lzma* requires `unlzma`. - *.lzma* requires `unlzma`.
- *.Z* requires `uncompress`. - *.Z* requires `uncompress`.
- *.zip* requires `unzip`. - *.zip*, *.jar* requires `unzip`.
- *.rar* requires `unrar` or `rar`. - *.rar* requires `unrar` or `rar`.
- *.7z* requires `7za`. - *.7z* requires `7za`.
- *.deb* requires `ar`, `tar`. - *.deb* requires `ar`, `tar`.

2
modules/archive/functions/_lsarchive

@ -10,4 +10,4 @@
_arguments \ _arguments \
'(-v --verbose)'{-v,--remove}'[verbose archive listing]' \ '(-v --verbose)'{-v,--remove}'[verbose archive listing]' \
"*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z)(-.)'" && return 0 "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|jar|rar|7z)(-.)'" && return 0

2
modules/archive/functions/_unarchive

@ -10,4 +10,4 @@
_arguments \ _arguments \
'(-r --remove)'{-r,--remove}'[remove archive]' \ '(-r --remove)'{-r,--remove}'[remove archive]' \
"*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0 "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|jar|rar|7z|deb)(-.)'" && return 0

2
modules/archive/functions/lsarchive

@ -40,7 +40,7 @@ while (( $# > 0 )); do
&& tar --lzma -t${verbose:+v}f "$1" \ && tar --lzma -t${verbose:+v}f "$1" \
|| lzcat "$1" | tar x${verbose:+v}f - ;; || lzcat "$1" | tar x${verbose:+v}f - ;;
(*.tar) tar t${verbose:+v}f "$1" ;; (*.tar) tar t${verbose:+v}f "$1" ;;
(*.zip) unzip -l${verbose:+v} "$1" ;; (*.zip|*.jar) unzip -l${verbose:+v} "$1" ;;
(*.rar) unrar &> /dev/null \ (*.rar) unrar &> /dev/null \
&& unrar ${${verbose:+v}:-l} "$1" \ && unrar ${${verbose:+v}:-l} "$1" \
|| rar ${${verbose:+v}:-l} "$1" ;; || rar ${${verbose:+v}:-l} "$1" ;;

2
modules/archive/functions/unarchive

@ -54,7 +54,7 @@ while (( $# > 0 )); do
(*.xz) unxz "$1" ;; (*.xz) unxz "$1" ;;
(*.lzma) unlzma "$1" ;; (*.lzma) unlzma "$1" ;;
(*.Z) uncompress "$1" ;; (*.Z) uncompress "$1" ;;
(*.zip) unzip "$1" -d $extract_dir ;; (*.zip|*.jar) unzip "$1" -d $extract_dir ;;
(*.rar) unrar &> /dev/null \ (*.rar) unrar &> /dev/null \
&& unrar x -ad "$1" \ && unrar x -ad "$1" \
|| rar x -ad "$1" ;; || rar x -ad "$1" ;;

Loading…
Cancel
Save