public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/less/files/
Date: Wed,  6 Apr 2016 22:09:42 +0000 (UTC)	[thread overview]
Message-ID: <1459980565.701215724afae290d5cab3ce63bb5805673738f6.vapier@gentoo> (raw)

commit:     701215724afae290d5cab3ce63bb5805673738f6
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Apr  6 21:45:29 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Apr  6 22:09:25 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=70121572

sys-apps/less: lesspipe: handle all non-regular files in main code

 sys-apps/less/files/lesspipe.sh | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/sys-apps/less/files/lesspipe.sh b/sys-apps/less/files/lesspipe.sh
index d659e39..c0f30e3 100755
--- a/sys-apps/less/files/lesspipe.sh
+++ b/sys-apps/less/files/lesspipe.sh
@@ -59,6 +59,15 @@ lesspipe() {
 		[[ ${match} == *.${ignore} ]] && exit 0
 	done
 
+	# Handle non-regular file types.
+	if [[ -d $1 ]] ; then
+		ls -alF -- "$1"
+		return
+	elif [[ ! -f $1 ]] ; then
+		stat "$1"
+		return
+	fi
+
 	case "${match}" in
 
 	### Doc files ###
@@ -234,14 +243,12 @@ lesspipe() {
 if [[ -z $1 ]] ; then
 	echo "Usage: lesspipe <file>"
 elif [[ $1 == "-V" || $1 == "--version" ]] ; then
-	Id="cvsid"
 	cat <<-EOF
-		$Id$
-		Copyright 2001-2013 Gentoo Foundation
+		lesspipe (git)
+		Copyright 2001-2016 Gentoo Foundation
 		Mike Frysinger <vapier@gentoo.org>
 		     (with plenty of ideas stolen from other projects/distros)
 
-
 	EOF
 	less -V
 elif [[ $1 == "-h" || $1 == "--help" ]] ; then
@@ -265,8 +272,6 @@ elif [[ $1 == "-h" || $1 == "--help" ]] ; then
 
 		Run 'less --help' or 'man less' for more info.
 	EOF
-elif [[ -d $1 ]] ; then
-	ls -alF -- "$1"
 else
 	recur=0
 	[[ -n ${LESSDEBUG} ]] \


             reply	other threads:[~2016-04-06 22:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06 22:09 Mike Frysinger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-04-06 22:09 [gentoo-commits] repo/gentoo:master commit in: sys-apps/less/files/ Mike Frysinger
2016-04-06 22:21 Mike Frysinger
2016-07-20  4:37 Mike Frysinger
2017-05-16 19:10 Mike Frysinger
2017-10-20  7:45 Patrice Clement
2018-10-31  8:06 Lars Wendler
2019-09-15  7:53 Mike Frysinger
2019-09-19 15:13 Mike Gilbert
2020-09-13 20:43 James Le Cuirot
2023-12-31  2:38 Conrad Kostecki
2024-03-16 12:13 Conrad Kostecki
2024-12-06 23:12 Conrad Kostecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1459980565.701215724afae290d5cab3ce63bb5805673738f6.vapier@gentoo \
    --to=vapier@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox