diff options
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/print.cc | 7 | ||||
-rw-r--r-- | src/libexpr/print.hh | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/libexpr/print.cc b/src/libexpr/print.cc index 8b45475d8..fbd91e484 100644 --- a/src/libexpr/print.cc +++ b/src/libexpr/print.cc @@ -509,4 +509,11 @@ std::ostream & operator<<(std::ostream & output, const ValuePrinter & printer) return output; } +template<> +hintformat & hintformat::operator%(const ValuePrinter & value) +{ + fmt % value; + return *this; +} + } diff --git a/src/libexpr/print.hh b/src/libexpr/print.hh index a8300264a..a542bc7b1 100644 --- a/src/libexpr/print.hh +++ b/src/libexpr/print.hh @@ -9,6 +9,7 @@ #include <iostream> +#include "fmt.hh" #include "print-options.hh" namespace nix { @@ -78,4 +79,13 @@ public: }; std::ostream & operator<<(std::ostream & output, const ValuePrinter & printer); + + +/** + * `ValuePrinter` does its own ANSI formatting, so we don't color it + * magenta. + */ +template<> +hintformat & hintformat::operator%(const ValuePrinter & value); + } |