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

Huidae Cho grass4u at gmail.com
Thu Jun 19 10:38:02 PDT 2014


Looks like we need pretty printing by default in terminal and parsable
printing by default in non-terminal with -p to force pretty printing. When
defaulting to pretty printing in terminal, we may need to ignore some flags
only meant for parsable output. Also, a flag to force parsable printing in
terminal would be useful too.



On Thu, Jun 19, 2014 at 8:03 AM, Glynn Clements <glynn at gclements.plus.com>
wrote:

>
> Huidae Cho wrote:
>
> > 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.
>
> I don't think that isatty() should be the sole determining factor. I'd
> rather see it used to select a default format but to allow the choice
> to be overridden.
>
> E.g. you might want the "pretty" format to still be used if the output
> is piped through more, less, pr, etc, but piping will result in stdout
> being a pipe rather than a tty.
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140619/e0d94ace/attachment.html>


More information about the grass-dev mailing list