summaryrefslogtreecommitdiff
path: root/man/ocamlc.m
diff options
context:
space:
mode:
authorHannes Mehnert <hannes@mehnert.org>2017-03-11 11:38:59 +0000
committerHannes Mehnert <hannes@mehnert.org>2017-03-15 08:24:13 +0000
commit76bf7c568e7997efd1a80073782f0eddfb2cecaa (patch)
tree3a4f3ac69410d13c4ff7cdcb08a095e950dafdbe /man/ocamlc.m
parent3ed575adbf22f8650ec625fb5c5cb5b235f89cd6 (diff)
downloadocaml-76bf7c568e7997efd1a80073782f0eddfb2cecaa.tar.gz
Respect OCAML_COLOR environment variable for deciding whether to use colors
Since 4.03, OCaml supports coloring its messages to standard output and standard error, depending on the "-color" argument ({always,never,auto}). This commit adds support for the environment variable "OCAML_COLOR" (which value can as well be {always,never,auto}). The command line argument "-color" takes precedence, "OCAML_COLOR" is only taken into consideration if no "-color" is provided. The motivation for this is that the user should have control over coloring OCaml's output messages. OCamlbuild, a widely used build tool executes OCaml not under a tty (and OCaml does not colorize errors and warnings), which lead various packages use `color(always)` in their `_tags` files, which breaks with other (non-interactive) programs (i.e. editor helpers). Further discussion was done at https://github.com/ocaml/ocamlbuild/issues/87 and https://github.com/ocaml/ocaml/pull/1098.
Diffstat (limited to 'man/ocamlc.m')
-rw-r--r--man/ocamlc.m3
1 files changed, 3 insertions, 0 deletions
diff --git a/man/ocamlc.m b/man/ocamlc.m
index bf66f6fe74..596b225c8e 100644
--- a/man/ocamlc.m
+++ b/man/ocamlc.m
@@ -282,6 +282,9 @@ and the current heuristic
checks that the "TERM" environment variable exists and is
not empty or "dumb", and that isatty(stderr) holds.
+The environment variable "OCAML_COLOR" is considered if \-color is not
+provided. Its values are auto/always/never as above.
+
.TP
.B \-compat\-32
Check that the generated bytecode executable can run on 32-bit