Use adaptive units for image and container prune reclaimed-space output (#40810)
AmirMS committed
Jun 16, 2026 at 18:17 UTC
ad02b12150ffe82c5fd866ab708cc6a4e0ada9cf
4 files changed
+9
-9
localization/strings/en-US/Resources.resw
+6
-6
@@ -2469,9 +2469,9 @@ For privacy information about this product please visit https://aka.ms/privacy.<
2469
<data name="WSLCCLI_ContainerPruneLongDesc" xml:space="preserve">
2470
<value>Removes all stopped containers.</value>
2471
</data>
2472
- <data name="WSLCCLI_ContainerPruneSpaceReclaimed" xml:space="preserve">
2473
- <value>Total reclaimed space: {:.2f} MB</value>
2474
- <comment>{FixedPlaceholder="{:.2f}"}Command line arguments, file names and string inserts should not be translated</comment>
2472
+ <data name="WSLCCLI_ContainerPruneSpaceReclaimedBytes" xml:space="preserve">
2473
+ <value>Total reclaimed space: {}</value>
2474
+ <comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
2475
</data>
2476
<data name="WSLCCLI_ContainerRemoveDesc" xml:space="preserve">
2477
<value>Remove containers.</value>
@@ -2562,9 +2562,9 @@ For privacy information about this product please visit https://aka.ms/privacy.<
2562
<value>Removes all dangling images. If --all is specified, removes all images not used by any container.</value>
2563
<comment>{Locked="--all "}Command line arguments, file names and string inserts should not be translated</comment>
2564
</data>
2565
- <data name="WSLCCLI_ImagePruneSpaceReclaimed" xml:space="preserve">
2566
- <value>Total reclaimed space: {:.2f} MB</value>
2567
- <comment>{FixedPlaceholder="{:.2f}"}Command line arguments, file names and string inserts should not be translated</comment>
2565
+ <data name="WSLCCLI_ImagePruneSpaceReclaimedBytes" xml:space="preserve">
2566
+ <value>Total reclaimed space: {}</value>
2567
+ <comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
2568
</data>
2569
<data name="WSLCCLI_ImagePruneUntagged" xml:space="preserve">
2570
<value>Untagged: {}</value>
src/windows/wslc/tasks/ContainerTasks.cpp
+1
-1
@@ -795,6 +795,6 @@ void PruneContainers(CLIExecutionContext& context)
795
}
796
797
PrintMessage(L"");
798
- PrintMessage(Localization::WSLCCLI_ContainerPruneSpaceReclaimed(static_cast<double>(result.SpaceReclaimed) / WSLC_IMAGE_1MB));
798
+ PrintMessage(Localization::WSLCCLI_ContainerPruneSpaceReclaimedBytes(wsl::shared::string::FormatBytes(result.SpaceReclaimed)));
799
}
800
} // namespace wsl::windows::wslc::task
src/windows/wslc/tasks/ImageTasks.cpp
+1
-1
@@ -341,6 +341,6 @@ void PruneImages(CLIExecutionContext& context)
341
}
342
343
PrintMessage(L"");
344
- PrintMessage(Localization::WSLCCLI_ImagePruneSpaceReclaimed(static_cast<double>(result.SpaceReclaimed) / WSLC_IMAGE_1MB));
344
+ PrintMessage(Localization::WSLCCLI_ImagePruneSpaceReclaimedBytes(wsl::shared::string::FormatBytes(result.SpaceReclaimed)));
345
}
346
} // namespace wsl::windows::wslc::task
test/windows/wslc/e2e/WSLCE2EContainerPruneTests.cpp
+1
-1
@@ -54,7 +54,7 @@ class WSLCE2EContainerPruneTests
54
const auto result = RunWslc(L"container prune");
55
result.Verify({.Stderr = L"", .ExitCode = 0});
56
57
- VERIFY_IS_TRUE(result.StdoutContainsSubstring(Localization::WSLCCLI_ContainerPruneSpaceReclaimed(0.0)));
57
+ VERIFY_IS_TRUE(result.StdoutContainsSubstring(L"Total reclaimed space:"));
58
}
59
60
WSLC_TEST_METHOD(WSLCE2E_Container_Prune_StoppedContainer)