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 <[email protected]> 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" <[email protected]> wrote: > >> >> On Tue, Jun 3, 2014 at 3:43 AM, Huidae Cho <[email protected]> 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. >> >
_______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
