[GRASS-dev] list organization of g.list output
paul-grass at stjohnspoint.co.uk
Fri May 25 12:48:40 CEST 2007
On Fri, 25 May 2007, Hamish wrote:
> Eric wrote:
>> While we're on topic, maybe a separator parameter like g.mlist? I've
>> always found that a very convenient feature.
> Francesco wrote:
>> ls changes to single column when ever stdout is not a tty.
>> That approach could be useful in the g.list case also I think.
> why not just use g.mlist if you want those?
> if(!tty) too "tricky"?
It's not tricky to do it:
but tricky I suppose that the output will be different depending on where
the module is writing to, which should be avoided I think.
>> For scripting, it would also be nice if it printed like this...
> and that IS just g.mlist.
> Granted g.mlist is just a wrapper around g.list's output, and allowing
> g.mlist to work on a -1 preformatted list would make it much less brittle.
> e.g. with today's changes we need to test that g.mlist still works.
I just checked and it does. It means the filenames will come into it in a
different order, but it sorts them anyway so the output should be just the
>> The only thing I can think that a perline option would be useful would
>> be if you wanted 1-column output for this sort of thing - if we made
>> that automatic depending on where stdout was going might that be
>> enough functionality??
> $COLUMNS always seems to be problematic for me (rxvt). Hardcode at 76?
> see bug #1107 http://intevation.de/rt/webrt?serial_num=1107
In G_ls* the terminal width is determined using a call to ioctl(). It
seems to work well on Unix where I've tested it. Do you think 76 might be
a better default that 80 for systems where it doesn't work?
>> If someone wants to add an option to g.list for 1-column output it
>> should be possible now (by changing the argument passed to
> Making g.mlist that much simpler, or even redundant.
> (so /bin/sh not needed for that functionality)
Yes, when I think about it though there's no reason why all of g.mlist's
functionality couldn't be added to g.list.
More information about the grass-dev