From a5d6fbd7354c2f02af5cb1e21f781cf9e2939946 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 4 Nov 2016 14:57:45 -0400 Subject: added comments to code from 9361c51 (#693) --- ranger/config/rifle.conf | 4 +++- ranger/data/scope.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf index aae60ea7..aadc2f2c 100644 --- a/ranger/config/rifle.conf +++ b/ranger/config/rifle.conf @@ -181,8 +181,10 @@ ext xcf, X, flag f = gimp -- "$@" #------------------------------------------- # Archives #------------------------------------------- -# This requires atool + +# avoid password prompt by providing empty password ext 7z, has 7z = 7z -p l "$@" | "$PAGER" +# This requires atool ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has als = als -- "$@" | "$PAGER" ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has als = als -- "$@" | "$PAGER" ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has aunpack = aunpack -- "$@" diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 8bccd12b..a0fb2ec0 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -72,9 +72,11 @@ case "$extension" in try bsdtar -lf "$path" && { dump | trim; exit 0; } exit 1;; rar) + # avoid password prompt by providing empty password try unrar -p- lt "$path" && { dump | trim; exit 0; } || exit 1;; 7z) - try 7z -p l "$path" && { dump | trim; exit 0; } || exit 1;; + # avoid password prompt by providing empty password + try 7z -p l "$path" && { dump | trim; exit 0; } || exit 1;; # PDF documents: pdf) try pdftotext -l 10 -nopgbrk -q "$path" - && \ -- cgit 1.4.1-2-gfad0