coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ls: do not print directory indicator for root


From: Bob Proulx
Subject: Re: [PATCH] ls: do not print directory indicator for root
Date: Sun, 12 May 2013 17:24:08 -0600
User-agent: Mutt/1.5.21 (2010-09-15)

Pádraig Brady wrote:
> Thanks for the patch,
> however I still think it adds inconsistency for little gain.

Creating this inconsistency also feels wrong to me too.  It just
doesn't seem right that everything else is implemented consistently
but this one case is made special.  In effect making this case
inconsistent with the others.

> It was mentioned that a trailing / is confusing and could
> be mistaken for a separate // root indicator.
> 
> Though consider:
> 
> $ /bin/ls -Fd --color //
> ///
> 
> That demonstrates the already possible ambiguity in root indicators.
> More importantly though, the trailing / has a different color to that
> of the specified path, which in the normal case should avoid ambiguity?

Agreed.  Also consider this case: (With the color indicated for email.
Probably better if you run the command yourself.)

  $ env ls -Fdlog --color / /var /var/tmp
  drwxr-xr-x 25  4096 May  8 23:29 <blue>/</blue>/
  drwxr-xr-x 14  4096 Aug 29  2011 <blue>/var</blue>/
  drwxrwxrwt  3 20480 May 12 16:04 <blue>/var/tmp</blue>/

It doesn't seem right that it would ever display this way:

  $ env ls -Fdlog --color / /var /var/tmp
  drwxr-xr-x 25  4096 May  8 23:29 <blue>/</blue>
  drwxr-xr-x 14  4096 Aug 29  2011 <blue>/var</blue>/
  drwxrwxrwt  3 20480 May 12 16:04 <blue>/var/tmp</blue>/

That just seems wrong to me.  Why would that one be different.

> Also I'm not sure about treating root specially here.
> This generally is when any directory is specified with trailing /
> 
> $ /bin/ls -dF --color ~/
> /home/padraig//

Another good example.

> Again color and context should avoid any ambiguity?

I would say * consistency *, color and context.  With emphasis on
consistency.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]