[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH]: ls: add --user-format option for user defined format
From: |
Paul Eggert |
Subject: |
Re: [PATCH]: ls: add --user-format option for user defined format |
Date: |
Fri, 21 Nov 2008 10:24:56 -0800 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) |
Jim Meyering <address@hidden> writes:
> - is it worthwhile to add a --printf option to ls?
> I don't like the --user-format name)
>
> - if so, should it use use a find -printf-compatible format string
> or one compatible to stat --printf? Either way, it'll need a few
> extensions.
I think it's worthwhile (as long as someone else does it :-) but I'm
afraid that neither find's nor stat's printf options are up to ls's main
task, which is to generate nice output for humans.
ls is pretty good about lining up columns, even when the column data is
unexpectedly wide, whereas 'find' and 'stat' are not. I would expect
that a -printf option to 'ls' would normally autoadjust column widths,
but neither 'find' nor 'stat' does that now.
I don't see a strong need to maintain absolute compatibility with find
-printf or with stat -printf. Obviously we shouldn't be gratuitously
compatible, but we might as well do it 'right' for 'ls', propagating any
improvements to 'stat'. (find -printf is not standardized by POSIX, so
there's not a huge portability issue there.)
I just now looked at the documentation for stat -printf and find
-printf. The stat documentation is easier to read, and has some
features that I'd expect people would find useful (e.g., quoting file
names with funny characters). The find documentation has some fancy
features for time stamp formatting, which I couldn't figure out from the
documentation; I suggest cleaning that up in 'ls', for example, by
having a --time-format=FORMAT option that specifies the time format in a
strftime-like way.
- Re: [PATCH]: ls: add --user-format option for user defined format, (continued)
- Re: [PATCH]: ls: add --user-format option for user defined format, Pádraig Brady, 2008/11/04
- Re: [PATCH]: ls: add --user-format option for user defined format, Ondřej Vašík, 2008/11/04
- Re: [PATCH]: ls: add --user-format option for user defined format, Jim Meyering, 2008/11/07
- Re: [PATCH]: ls: add --user-format option for user defined format, James Youngman, 2008/11/08
- Re: [PATCH]: ls: add --user-format option for user defined format, Ondřej Vašík, 2008/11/10
- Re: [PATCH]: ls: add --user-format option for user defined format, Pádraig Brady, 2008/11/10
- Re: [PATCH]: ls: add --user-format option for user defined format, Ondřej Vašík, 2008/11/20
- Re: [PATCH]: ls: add --user-format option for user defined format, Jim Meyering, 2008/11/20
- Re: [PATCH]: ls: add --user-format option for user defined format, Pádraig Brady, 2008/11/20
- Re: [PATCH]: ls: add --user-format option for user defined format, Ondřej Vašík, 2008/11/20
- Re: [PATCH]: ls: add --user-format option for user defined format,
Paul Eggert <=
- Re: [PATCH]: ls: add --user-format option for user defined format, Jim Meyering, 2008/11/21
- Re: [PATCH]: ls: add --user-format option for user defined format, Jim Meyering, 2008/11/22
- Re: [PATCH]: ls: add --user-format option for user defined format, Bob Proulx, 2008/11/24
- Re: [PATCH]: ls: add --user-format option for user defined format, martin f krafft, 2008/11/25