--human defaults to SI; add --si alias + numeric synonyms - #275
Merged
Conversation
Human sizes (-ls / --summary) now default to SI (kB/MB, 1000^N) rather than IEC, since IEC's `i` reads less human. Bare --human and the new --si both select SI; the xff/rg style default flips from iec to si too. --human=iec (or =1024) still selects binary (KiB/MiB), =si (or =1000) decimal, =off raw bytes. The renderer already spells each scale correctly (SI kB lowercase, IEC KiB) and never mixes them at one site. - ResolveHuman: style default kIec -> kSi; accepts --si, --human=1000 (si), --human=1024 (iec); iterates the globals as string_view. - New --si global (an alias for --human=si); --human summary/display updated (si is the default). - The `sizes` flavor facet auto-updates (find=bytes, xff=si, rg=si) via HumanName(ResolveHuman()). Tests: summary_test - the default-xff case now expects kB; a new case locks bare --human = SI and --si = SI (both decimal MB, no MiB); the iec + precision cases pin --human=iec explicitly. `bazel test //xff/...` green (67). #113: input unit grammars (-size/-blocks/--block-size/--buffer) stay find-native binary and are never printed with a suffix, so there is no SI/IEC mismatch there; documented in TODO as a possible later refinement (explicit KiB-style input units + --help=size rule).
helly25
enabled auto-merge (squash)
July 6, 2026 00:27
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.
Per your call on #113: human sizes (
-ls/--summary) now default to SI (kB/MB, 1000^N)rather than IEC, since IEC's
ireads less human.--humanalready existed; this flips the defaultand rounds out the spellings.
--humanand the new--siboth select SI. The xff/rg style default flips fromiectositoo.--human=iec(or=1024) selects binary (KiB/MiB);=si(or=1000) decimal;=offraw bytes.kB(lowercase kilo), IECKiB- and nevermixes them at one site, which is the core of feat(engine): -printf time directives %a/%c/%t + %Ak/%Ck/%Tk #113.
Scope note (in TODO)
The only unit-suffixed output is the human renderer; the input unit grammars
(
-size/-blocks/--block-size,--buffer) stay find-native binary and are never printed with asuffix, so there's no SI/IEC mismatch to fix there - recorded as a possible later refinement.
Tests
summary_test: default-xff now expectskB; a new case locks bare--human= SI and--si= SI(decimal
MB, noMiB); the iec + precision cases pin--human=iecexplicitly. Thesizesflavorfacet auto-updates (find=bytes, xff=si, rg=si).
bazel test //xff/...green (67).