From cc8168ddf6bab2a616319431c0b9eb5636e1fe18 Mon Sep 17 00:00:00 2001 From: nasenatmer Date: Sat, 18 May 2013 13:22:17 +0100 Subject: [PATCH] Add `rar` command to `ls-archive` function. --- modules/archive/functions/ls-archive | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/archive/functions/ls-archive b/modules/archive/functions/ls-archive index e8727fa1..99ebde6e 100644 --- a/modules/archive/functions/ls-archive +++ b/modules/archive/functions/ls-archive @@ -41,7 +41,9 @@ while (( $# > 0 )); do || lzcat "$1" | tar x${verbose:+v}f - ;; (*.tar) tar t${verbose:+v}f "$1" ;; (*.zip) unzip -l${verbose:+v} "$1" ;; - (*.rar) unrar ${${verbose:+v}:-l} "$1" ;; + (*.rar) unrar &> /dev/null \ + && unrar ${${verbose:+v}:-l} "$1" \ + || rar ${${verbose:+v}:-l} "$1" ;; (*.7z) 7za l "$1" ;; (*) print "$0: cannot list: $1" >&2