From 9520f1be6f8ef13cdf599df09a286d21ec034dc7 Mon Sep 17 00:00:00 2001 From: Nicola Corna Date: Tue, 19 Sep 2017 01:27:31 +0200 Subject: [PATCH 1/2] archive: fix unrar-free and add support for unar (#1383) * archive: fix unrar check when using unrar-free unrar-free returns the error code 1 when run without arguments, thus failing the presence check. Replacing the current presence check with (( $+commands[unrar] )) fixes the problem. * archive: add unar support for lsarchive and unarchive No `archive` support with unar. --- modules/archive/README.md | 2 +- modules/archive/functions/lsarchive | 8 +++++--- modules/archive/functions/unarchive | 8 +++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/archive/README.md b/modules/archive/README.md index 6df58d86..c2ab938a 100644 --- a/modules/archive/README.md +++ b/modules/archive/README.md @@ -27,7 +27,7 @@ installed: - *.lzma* requires `unlzma`. - *.Z* requires `uncompress`. - *.zip*, *.jar* requires `unzip`. - - *.rar* requires `unrar` or `rar`. + - *.rar* requires `rar` (needed for `archive` support), `unrar` or `lsar` and `unar`. - *.7z* requires `7za`. - *.deb* requires `ar`, `tar`. diff --git a/modules/archive/functions/lsarchive b/modules/archive/functions/lsarchive index d2bd8341..7f892d1f 100644 --- a/modules/archive/functions/lsarchive +++ b/modules/archive/functions/lsarchive @@ -43,9 +43,11 @@ while (( $# > 0 )); do || lzcat "$1" | tar x${verbose:+v}f - ;; (*.tar) tar t${verbose:+v}f "$1" ;; (*.zip|*.jar) unzip -l${verbose:+v} "$1" ;; - (*.rar) unrar &> /dev/null \ - && unrar ${${verbose:+v}:-l} "$1" \ - || rar ${${verbose:+v}:-l} "$1" ;; + (*.rar) ( (( $+commands[unrar] )) \ + && unrar ${${verbose:+v}:-l} "$1" ) \ + || ( (( $+commands[rar] )) \ + && rar ${${verbose:+v}:-l} "$1" ) \ + || lsar ${verbose:+-l} "$1" ;; (*.7z) 7za l "$1" ;; (*) print "$0: cannot list: $1" >&2 diff --git a/modules/archive/functions/unarchive b/modules/archive/functions/unarchive index c9ed1488..53a24dd7 100644 --- a/modules/archive/functions/unarchive +++ b/modules/archive/functions/unarchive @@ -57,9 +57,11 @@ while (( $# > 0 )); do (*.lzma) unlzma "$1" ;; (*.Z) uncompress "$1" ;; (*.zip|*.jar) unzip "$1" -d $extract_dir ;; - (*.rar) unrar &> /dev/null \ - && unrar x -ad "$1" \ - || rar x -ad "$1" ;; + (*.rar) ( (( $+commands[unrar] )) \ + && unrar x -ad "$1" ) \ + || ( (( $+commands[rar] )) \ + && rar x -ad "$1" ) \ + || unar -d "$1" ;; (*.7z) 7za x "$1" ;; (*.deb) mkdir -p "$extract_dir/control" From 1d0bee60989602c921251ab259327a2cf11b90d3 Mon Sep 17 00:00:00 2001 From: sergiorussia Date: Tue, 19 Sep 2017 10:38:24 +0300 Subject: [PATCH 2/2] Fix README.md for autosuggestions and history-substring-search (#1471) --- modules/autosuggestions/README.md | 4 ++-- modules/history-substring-search/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/autosuggestions/README.md b/modules/autosuggestions/README.md index 4d18f916..ad0f7ece 100644 --- a/modules/autosuggestions/README.md +++ b/modules/autosuggestions/README.md @@ -12,10 +12,10 @@ of a previously entered command and Zsh suggests commands as you type based on history and completions. If this module is used in conjunction with the *syntax-highlighting* module, -the *syntax-highlighting* module must be loaded **after** this module. +this module must be loaded **after** the *syntax-highlighting* module. If this module is used in conjunction with the *history-substring-search* -module, the *history-substring-search* module must be loaded **after** this +module, this module must be loaded **after** the *history-substring-search* module. Contributors diff --git a/modules/history-substring-search/README.md b/modules/history-substring-search/README.md index 0da63dcc..050a5c2e 100644 --- a/modules/history-substring-search/README.md +++ b/modules/history-substring-search/README.md @@ -6,8 +6,8 @@ the [Fish shell][2]'s history search feature, where the user can type in any part of a previously entered command and press up and down to cycle through matching commands. -If this module is used in conjuncture with the *syntax-highlighting* module, it -must be loaded **after** it. +If this module is used in conjunction with the *syntax-highlighting* module, +this module must be loaded **after** the *syntax-highlighting* module. Contributors ------------