[Chapel Merge] Change Mason `--no-color` flag to `--color=MODE`

Branch: refs/heads/main
Revision: b15eaf073476bb55ad28c5b35d5b062eea0b6d9c
Author: jabraham17
Link: Change Mason `--no-color` flag to `--color=MODE` by jabraham17 · Pull Request #28478 · chapel-lang/chapel · GitHub
Log Message:
Change Mason --no-color flag to --color=MODE (#28478)

Switch the mason flag --no-color to --color=MODE to allow users to
select the color mode.

In this PR, there are 3 color modes

  • --color=always - always print color output
  • --color=never - never print color output
  • --color=auto - detect the output stream, if its an interactive
    device use color, otherwise don't use color

To support this, I added a new method to IO.file to invoke isatty.
It is currently nodoced.

  • paratest

In the future, I'd like to refactor things so --color can be applied
to any mason command. e.g. mason run --color=always instead of mason --color=always run. But to do that in a maintainable way is a lot of
work

[Reviewed by @benharsh]

Compare: Comparing cd394bc2395450868e44eeec6d16f2e18c9426a6...714df52cd2f76e45df7af34ea830433c89994461 · chapel-lang/chapel · GitHub

Diff:
M modules/standard/IO.chpl
M runtime/include/qio/qio.h
M runtime/src/qio/qio.c
A test/mason/bashtests/.gitignore
A test/mason/bashtests/CLEANFILES
A test/mason/bashtests/EXECENV
A test/mason/bashtests/README
A test/mason/bashtests/colorOutput.good
A test/mason/bashtests/colorOutput.masontest
A test/mason/bashtests/sub_test
M test/mason/mason-new-init/initErrors.good
M test/mason/mason-new-init/initErrors.masontest
M test/mason/search/badFileName/mason-search.chpl
M test/mason/search/mason-search.chpl
M tools/mason/Mason.chpl
M tools/mason/MasonLogger.chpl
https://github.com/chapel-lang/chapel/pull/28478.diff