On Fri, Mar 28, 2008 at 06:16:06AM -0500, Todd Walton wrote:
On Thu, Mar 27, 2008 at 11:49 PM, David Brown <[EMAIL PROTECTED]> wrote:
 I think that Lan's concern here is scriptability, which is important.  But,
 having a --quiet option is sufficient for this.  But, showing progress
 should be the default.  Most users will start pressing ^C and other things
 for even a command line program that doesn't print anything for a few
 seconds.

Couldn't a program detect if it's running in an interactive shell or not?

Yes, and a lot do that.  But, it's also has it's disadvantages, because now
the program behaves differently based on something that isn't passed into
it.  At least the common ones, such as 'ls' color output, have to be
explicity set to 'auto' mode to get this behavior.

There's a whole library call isatty() that will tell you if a file
descriptor is connected to a terminal or not, so it's very easy to do.

Another common change is to filter output through a pager if there is a
terminal, and otherwise, just output the data.

David


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to