jlogsdon/php-cli-tools — pull request #14 by goldenapples (2012-10-03 23:40:44+00:00)
Title: Don't colorize piped output

A followup to issue #13.

A rough POC of using the `posix_isatty()` function to determine whether or
not to colorize output. This probably needs refactoring somehow - for
one, this assumes that checking the **$out** stream is sufficient, but the
checking should be done on a per-stream basis. Also, it would be nice to
be able to pass **$colorize** into the script as a variable (for example, in
a script that offered a `--porcelain` option), but since this function is already
accepting so many different types of output, it would be very hard to allow
that without breaking existing implementations.

Thoughts?