<div dir="ltr">Hmm... one flag -s (switch default) should be enough, I think.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 19, 2014 at 1:38 PM, Huidae Cho <span dir="ltr"><<a href="mailto:grass4u@gmail.com" target="_blank">grass4u@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.<div>
<br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 19, 2014 at 8:03 AM, Glynn Clements <span dir="ltr"><<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
Huidae Cho wrote:<br>
<br>
> IMO, if we replace g.list with g.mlist, it would be better to remove the -p<br>
> flag and switch between the pretty output and machine-friendly output based<br>
> on isatty(STDOUT_FILENO). In most cases, if the user types a command from<br>
> the terminal without redirecting, they want to *see* output, not *parse*<br>
> it. This way, the new g.list (current g.mlist) will be backward compatible<br>
> *unless* any scripts depend on saved output of the old g.list. Also, we can<br>
> save additional typing.<br>
><br>
> But I'm not sure if it's a good idea to print two different outputs based<br>
> on isatty.<br>
<br>
</div>I don't think that isatty() should be the sole determining factor. I'd<br>
rather see it used to select a default format but to allow the choice<br>
to be overridden.<br>
<br>
E.g. you might want the "pretty" format to still be used if the output<br>
is piped through more, less, pr, etc, but piping will result in stdout<br>
being a pipe rather than a tty.<br>
<span><font color="#888888"><br>
--<br>
Glynn Clements <<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>><br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>