Re: ls.1: incorrect -O flag description

Valery Ushakov <[email protected]>
Newsgroups gmane.os.netbsd.devel.userlevel
Message-ID <[email protected]>
Hi, Thor.

Do you remember what was the original intention behind ls -O?

On Fri, Oct 11, 2024 at 13:16:32 +0200, [email protected] wrote:

> On Fri, Oct 11, 2024 at 05:35:11AM +0300, Valery Ushakov wrote:
> > On Thu, Oct 10, 2024 at 21:37:15 +0200, [email protected] wrote:
> > 
> > > The -O (not a POSIX one) flag seems incorrectly described in the manual
> > > page.
> > > 
> > > What it does (from a cursory look at the sources, matching the result
> > > of testing), is simply not displaying a supplementary information
> > > about the directory traversed when going recursive.
> > > 
> > > It does not output only leaf (filenames not directory). This is only
> > > the "headline": "\ndir:\n" that is not displayed.
> > > 
> > > Just try:
> > > 
> > > $ ls -OF
> > > 
> > > for example (and combine with -R).
> > > 
> > > What was the intention of the flag? To have an output with just the
> > > names (including directories) without the formatting about the newline
> > > and the dir?
> > 
> > revision 1.71
> > date: 2014-02-20 22:56:36 +0400;  author: christos;  state: Exp;  lines: +18 -8;
> > Add -O (only leaf files) and -P (print full path), from tls@
> > 
> > Seems buggy too
> > 
> > $ mkdir -p 1/2/3/4
> > $ touch 1/2/200
> > $ find .
> > .
> > ./1
> > ./1/2
> > ./1/2/3
> > ./1/2/3/4
> > ./1/2/200
> > $ ls -RPO
> > ./1
> > ./1/2
> > ./1/2/200./1/2/3
> > ./1/2/3/4
> > 
> > Can you file a PR, please? TIA.
> > 
> 
> Done: bin/58740
> 
> And for me the solution is to suppress the flag altogether---what
> the manpage says it is supposed to do can be done with find(1).

-uwe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.