summaryrefslogtreecommitdiff
path: root/src/util.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.ml')
-rw-r--r--src/util.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util.ml b/src/util.ml
index b8670b84..94caf9fc 100644
--- a/src/util.ml
+++ b/src/util.ml
@@ -95,6 +95,7 @@
(**************************************************************************)
let opt_warnings = ref true
+let opt_colors = ref true
let rec last = function
| [x] -> x
@@ -388,7 +389,10 @@ let rec take n xs = match n, xs with
| n, [] -> []
| n, (x :: xs) -> x :: take (n - 1) xs
-let termcode n = "\x1B[" ^ string_of_int n ^ "m"
+let termcode n =
+ if !opt_colors then
+ "\x1B[" ^ string_of_int n ^ "m"
+ else ""
let bold str = termcode 1 ^ str