Skip to content

Commit

Permalink
archive: add support for *.jar files (sorin-ionescu#1302)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaro0508 authored and drpebcak committed May 15, 2017
1 parent 0eecdf1 commit 7931446
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/archive/README.md
Expand Up @@ -25,7 +25,7 @@ installed:
- *.xz* requires `unxz`.
- *.lzma* requires `unlzma`.
- *.Z* requires `uncompress`.
- *.zip* requires `unzip`.
- *.zip*, *.jar* requires `unzip`.
- *.rar* requires `unrar` or `rar`.
- *.7z* requires `7za`.
- *.deb* requires `ar`, `tar`.
Expand Down
2 changes: 1 addition & 1 deletion modules/archive/functions/_lsarchive
Expand Up @@ -10,4 +10,4 @@

_arguments \
'(-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 changes: 1 addition & 1 deletion modules/archive/functions/_unarchive
Expand Up @@ -10,4 +10,4 @@

_arguments \
'(-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 changes: 1 addition & 1 deletion modules/archive/functions/lsarchive
Expand Up @@ -40,7 +40,7 @@ while (( $# > 0 )); do
&& tar --lzma -t${verbose:+v}f "$1" \
|| lzcat "$1" | tar x${verbose:+v}f - ;;
(*.tar) tar t${verbose:+v}f "$1" ;;
(*.zip) unzip -l${verbose:+v} "$1" ;;
(*.zip|*.jar) unzip -l${verbose:+v} "$1" ;;
(*.rar) unrar &> /dev/null \
&& unrar ${${verbose:+v}:-l} "$1" \
|| rar ${${verbose:+v}:-l} "$1" ;;
Expand Down
2 changes: 1 addition & 1 deletion modules/archive/functions/unarchive
Expand Up @@ -54,7 +54,7 @@ while (( $# > 0 )); do
(*.xz) unxz "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.Z) uncompress "$1" ;;
(*.zip) unzip "$1" -d $extract_dir ;;
(*.zip|*.jar) unzip "$1" -d $extract_dir ;;
(*.rar) unrar &> /dev/null \
&& unrar x -ad "$1" \
|| rar x -ad "$1" ;;
Expand Down

0 comments on commit 7931446

Please sign in to comment.