[GRASS-dev] g.mlist list multiple types from all mapsets

Huidae Cho grass4u at gmail.com
Wed Jun 18 08:20:44 PDT 2014


IMO, if we replace g.list with g.mlist, it would be better to remove the -p
flag and switch between the pretty output and machine-friendly output based
on isatty(STDOUT_FILENO). In most cases, if the user types a command from
the terminal without redirecting, they want to *see* output, not *parse*
it. This way, the new g.list (current g.mlist) will be backward compatible
*unless* any scripts depend on saved output of the old g.list. Also, we can
save additional typing.

But I'm not sure if it's a good idea to print two different outputs based
on isatty.


On Sun, Jun 8, 2014 at 10:57 AM, Huidae Cho <grass4u at gmail.com> wrote:

> G.mlist seems to be tested enough (?), but is someone testing the new
> g.mremove (g.mlist interface)? It worked for me at least...
>
> I think it's safe to replace g.list with g.mlist at this point, but I have
> a good history of getting reverted ;-). No more votes and 0 vetoes. Good or
> bad sign?
>  On Jun 6, 2014 12:18 PM, "Vaclav Petras" <wenzeslaus at gmail.com> wrote:
>
>>
>> On Tue, Jun 3, 2014 at 3:43 AM, Huidae Cho <grass4u at gmail.com> wrote:
>>
>>> I tested g.mlist with the attached script. I started from
>>> test_g_list.py and replaced g.list with g.mlist -p and g.list -f with g.
>>> mlist -f. g.mlist passed the test, which means g.list == g.mlist -p & g.list
>>> -f == g.mlist -f.
>>>
>>
>> More tests needed. g.mlist does not complain about not existing mapset:
>>
>> $ g.mlist pattern="lsat*" type=rast mapset=xxxxxx
>> [no output]
>> $ echo $?
>> 0
>>
>> By the way, is multiple for mapset a planned feature? Or it is too much?
>> Pattern for mapset seems too much for sure.
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140618/b44d23fe/attachment.html>


More information about the grass-dev mailing list