GNU bug report logs - #49716
no -print0 for ls?

Previous Next

Package: coreutils;

Reported by: Vito Caputo <vcaputo <at> pengaru.com>

Date: Sat, 24 Jul 2021 09:45:02 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Vito Caputo <vcaputo <at> pengaru.com>, 49716 <at> debbugs.gnu.org
Subject: bug#49716: no -print0 for ls?
Date: Wed, 28 Jul 2021 12:57:38 +0100
[Message part 1 (text/plain, inline)]
On 28/07/2021 02:14, Paul Eggert wrote:
> On 7/26/21 8:00 AM, Pádraig Brady wrote:
> 
>> So I'd have a slight preference for --zero.
>>
>> Also what about having --zero imply:
>>     --quoting-style=literal --show-control-chars --format=single-column
>> That seems like a fine shortcut given that would be correct in the vast
>> majority of cases,
>> and that the need for the above may not be obvious to users.
>>
>> Also a small point; should --dired disable --null as it may then be non
>> parseable?
> 
> Thanks, all good suggestions. For --dired vs --zero I thought it better
> simply to prohibit the combination since neither should be in 'ls' shell
> aliases, and prohibiting means we can add it later if we like. I
> installed the attached patches to do this (plus the other stuff I
> mentioned in my reply to Berny).
> 
> The first patch is a cleanup because I had a bit of trouble following
> the forest of 'if's inside of ls.c's decode_switches function and I
> thought it better to avoid unnecessary syscalls while I was at it.
> 
> The second patch does the real work.
> 

That all looks great.

I see --zero implies --format=single-column, but allows --format=long.
That's the right default, but also most flexible.

I'll apply the attached later to augment/document the test
with the various supported option combinations.

thanks!
Pádraig
[ls--zero-tests.patch (text/x-patch, attachment)]

This bug report was last modified 3 years and 353 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.