From 3188109649a6a6ecaa828eecf999ba6aaaea8708 Mon Sep 17 00:00:00 2001 From: WF Date: Sat, 31 Aug 2024 18:35:16 +0200 Subject: [PATCH] show dir listing instead of contents for tar_file:directory/ --- lesspipe.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lesspipe.sh b/lesspipe.sh index 62ad331..23e2c9e 100755 --- a/lesspipe.sh +++ b/lesspipe.sh @@ -476,7 +476,8 @@ has_colorizer () { ft=${3##*/} ft=${ft##*.} opt=(-c "$1" --cmd "set filetype=$ft") - fi ;; + fi + ;; *) return ;; esac @@ -655,10 +656,10 @@ isarchive () { case $prog in tar|bsdtar) [[ "$2" =~ ^[a-z_-]*:.* ]] && echo "$2: remote operation tar host:file not allowed" && return - if [[ "$3" =~ --* ]]; then - $prog Oxf "$2" "--" "$3" 2>/dev/null + if [[ "$3" =~ .*/$ ]]; then + $prog Otvf "$2" -- "$3" else - $prog Oxf "$2" "$3" 2>/dev/null + $prog Oxf "$2" -- "$3" 2>/dev/null fi ;; rar|unrar)