Jim Meyering <[EMAIL PROTECTED]> 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. _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
