diff --git a/src/libutil/fmt.hh b/src/libutil/fmt.hh index d182adc3a..bfacfeb4d 100644 --- a/src/libutil/fmt.hh +++ b/src/libutil/fmt.hh @@ -73,18 +73,31 @@ inline std::string fmt(const std::string & fs, const Args & ... args) // are always in yellow. template -struct yellowify +struct yellowtxt { - yellowify(T &s) : value(s) {} + yellowtxt(T &s) : value(s) {} T &value; }; template -std::ostream& operator<<(std::ostream &out, const yellowify &y) +std::ostream& operator<<(std::ostream &out, const yellowtxt &y) { return out << ANSI_YELLOW << y.value << ANSI_NORMAL; } +template +struct normaltxt +{ + normaltxt(T &s) : value(s) {} + T &value; +}; + +template +std::ostream& operator<<(std::ostream &out, const normaltxt &y) +{ + return out << ANSI_NORMAL << y.value; +} + class hintformat { public: @@ -100,7 +113,7 @@ public: template hintformat& operator%(const T &value) { - fmt % yellowify(value); + fmt % yellowtxt(value); return *this; }