diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-08-20 16:01:16 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-08-20 16:50:17 +0200 |
commit | 373fad75e19a2f24db512621b8cedb627d03d49d (patch) | |
tree | 640fd0cac2ccc58f2db5a3f39eba6d0d67badb22 /src/libutil/util.hh | |
parent | 392430b2c4ceb2e476abe2b3acc928581b2a1445 (diff) |
Add some color
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r-- | src/libutil/util.hh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 5f2d95339..f6f5d1b3f 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -369,4 +369,16 @@ string decodeOctalEscaped(const string & s); void ignoreException(); +/* Some ANSI escape sequences. */ +#define ANSI_NORMAL "\e[0m" +#define ANSI_BOLD "\e[1m" +#define ANSI_RED "\e[31;1m" + + +/* Filter out ANSI escape codes from the given string. If ‘nixOnly’ is + set, only filter escape codes generated by Nixpkgs' stdenv (used to + denote nesting etc.). */ +string filterANSIEscapes(const string & s, bool nixOnly = false); + + } |