aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/print-elided.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/print-elided.hh')
-rw-r--r--src/libutil/print-elided.hh23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/libutil/print-elided.hh b/src/libutil/print-elided.hh
new file mode 100644
index 000000000..a99b15ca1
--- /dev/null
+++ b/src/libutil/print-elided.hh
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <ostream>
+
+
+namespace nix {
+
+/**
+ * Print an `«... elided»` placeholder.
+ *
+ * Arguments are forwarded to `pluralize`.
+ *
+ * If `ansiColors` is set, the output will be wrapped in `ANSI_FAINT`.
+ */
+void printElided(
+ std::ostream & output,
+ unsigned int value,
+ const std::string_view single,
+ const std::string_view plural,
+ bool ansiColors
+);
+
+}