summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTim Harder <radhermit@gmail.com>2011-07-18 01:17:38 -0700
committerTim Harder <radhermit@gmail.com>2011-07-18 01:17:38 -0700
commitd0d194d886561622f4b5784ec0b23b8450fa8c2f (patch)
tree1b72ccdacc89e22e0746893e0da4adc722e4c8da
parent43153a6d91459a825e3dcc528cc340abe780d6af (diff)
downloadranger-d0d194d886561622f4b5784ec0b23b8450fa8c2f.tar.gz
data/scope.sh: show compressed text files with atool
Also, fix a minor spelling error.
-rwxr-xr-xranger/data/scope.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh
index 9f212cae..ca1f7e67 100755
--- a/ranger/data/scope.sh
+++ b/ranger/data/scope.sh
@@ -30,14 +30,15 @@ extension=$(echo "$path" | grep '\.' | grep -o '[^.]\+$')
 # Functions:
 # "have $1" succeeds if $1 is an existing command/installed program
 function have { type -P "$1" > /dev/null; }
-# "sucess" returns the exit code of the first program in the last pipe chain
+# "success" returns the exit code of the first program in the last pipe chain
 function success { test ${PIPESTATUS[0]} = 0; }
 
 case "$extension" in
 	# Archive extensions:
 	7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
 	rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
-		atool -l "$path" | head -n $maxln && exit 3
+		als "$path" | head -n $maxln
+		success && exit 0 || acat "$path" | head -n $maxln && exit 3
 		exit 1;;
 	# PDF documents:
 	pdf)