aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/fmt.hh
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2024-03-26 10:55:15 +0300
committerjade <lix@jade.fyi>2024-03-26 07:58:24 +0000
commita69f6e185adabf42cc310375b5b57d7dda52397c (patch)
treed3dd81ef060714e911a86681a1769aba8574f035 /src/libutil/fmt.hh
parent73624f7d9cc032dd0485824a25512112883e127f (diff)
build-remote: fix format string shenanigans
HintFmt(string) invokes the HintFmt("%s", literal) constructor, which is not what we want here. Add a constructor with a proper name and call that. Next step: rename all the other ones to HintFmt::literal(string). Fixes: https://git.lix.systems/lix-project/lix/issues/178 Change-Id: If52d2eb8864ceb8663e05992e9d1fffef573d6b8
Diffstat (limited to 'src/libutil/fmt.hh')
-rw-r--r--src/libutil/fmt.hh4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libutil/fmt.hh b/src/libutil/fmt.hh
index 75354a07c..84a3e3e11 100644
--- a/src/libutil/fmt.hh
+++ b/src/libutil/fmt.hh
@@ -141,6 +141,10 @@ public:
: HintFmt("%s", Uncolored(literal))
{ }
+ static HintFmt fromFormatString(const std::string & format) {
+ return HintFmt(boost::format(format));
+ }
+
/**
* Interpolate the given arguments into the format string.
*/