about summary refs log tree commit diff
path: root/src/libmain/shared.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmain/shared.cc')
-rw-r--r--src/libmain/shared.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index c83e997b2307..f300fbf1b463 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -342,4 +342,19 @@ RunPager::~RunPager()
 }
 
 
+string showBytes(unsigned long long bytes)
+{
+    return (format("%.2f MiB") % (bytes / (1024.0 * 1024.0))).str();
+}
+
+
+PrintFreed::~PrintFreed()
+{
+    if (show)
+        std::cout << format("%1% store paths deleted, %2% freed\n")
+            % results.paths.size()
+            % showBytes(results.bytesFreed);
+}
+
+
 }