Add --human=iec|si size units to --summary (#86 PR B) - #203
Merged
Conversation
Completes #86: format::Size(bytes, SizeUnits) renders a human-readable size (du -h / ls -h style) -- exact bytes under one unit ("56 B"), else the value scaled to the largest fitting unit with one decimal ("5.6 MiB", "5.9 MB"). kIec is binary (1024, KiB/MiB, matching -size); kSi is decimal (1000, kB/MB). --human[=iec|si] switches the --summary size column to units: bare --human / =iec is binary, =si decimal, absent stays raw grouped bytes; last occurrence wins. It affects only the human table -- --format=jsonl keeps exact byte counts (the machine path). Self-documentation: --human GlobalFlag (Output group) + kHelpText. Tests: format_test Size (iec + si across the unit range, exact-bytes boundary); cli/summary_test.sh --human iec/si rendering + that jsonl bytes are unchanged by --human. bazel test //... green (35 tests).
helly25
enabled auto-merge (squash)
July 2, 2026 18:28
helly25
added a commit
that referenced
this pull request
Jul 6, 2026
Remove five stale 'to do' bullets that describe already-implemented work, so TODO.md stops listing done features as open: - Right align numbers in summary -> shipped (#202, #235) - More output control for summary -> shipped (#86, #203, #275) - Align outputs like -ls -> shipped (#205, #206, #207) - Mimetype support -> shipped (#219 -mime) - File type support -> shipped (#262 -lang, #89) Fix the 'Color support' cross-reference that pointed at the removed 'File type support' bullet to name -lang / {lang} / languages.yml directly. Genuinely-open items (Line count {lines} field, per-file hashes, --sort/-j CLI test, histograms #81) are untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes #86 on the #202 formatter.
format::Size(bytes, SizeUnits)renders a human size (du -h / ls -h): exact bytes under one unit (56 B), else scaled to the largest fitting unit with one decimal (5.6 MiB,5.9 MB).kIec= binary (1024, KiB/MiB, matching-size);kSi= decimal (1000, kB/MB).--human[=iec|si]switches the--summarysize column to units - bare--human/=iecbinary,=sidecimal, absent = raw grouped bytes (last wins). Affects only the human table;--format=jsonlkeeps exact byte counts (the machine path).Self-doc:
--humanGlobalFlag (Output) +kHelpText.Tests:
format_testSize (iec + si across the range, exact-bytes boundary);cli/summary_test.shiec/si rendering + jsonl bytes unchanged by--human.bazel test //...green (35 tests).