Display the unit currently used (and also fix the manpage)
Currently, dfc displays sizes according to binary prefixes, unless `-m` is passed.
However, the displayed size will always be 'G', 'M', etc.
Here, the current manpage, about the format section, uses `Gio`, `Mio`, and so on. Those are correct French units, but they should be `GiB`, 'MiB`, 'KiB', etc.
I would actually recommend displaying the full unit, to avoid mixing up bits and bytes: Gi could be GiB or Gib, which are different.
Therefore, here is my full proposal: (read the wikipedia article as well: https://en.wikipedia.org/wiki/Binary_prefix)
Without `-m`, the units should be displayed as following:
'YiB', 'ZiB', 'EiB', 'PiB', 'TiB', 'GiB', 'MiB', 'KiB', 'B'
With `-m`, the display would accomodate the SI prefixes:
'YB', 'ZB', 'EB', 'PB', 'TB', 'GB', 'MB', 'KB', 'B'
The `unit` section of the manpage should be changed to:
Show size using the unit specified. UNIT can take one of the following values:
"h": Human readable (default when not using "-u" option).
"b": Show bytes.
"k": Show size using KiB.
"m": Show size using MiB.
"g": Show size using GiB.
"t": Show size using TiB.
"p": Show size using PiB.
"e": Show size using EiB.
"z": Show size using ZiB.
"y": Show size using YiB.
NOTE: When using "-u" option along with "-m" option, those suboptions are replaced by their SI counterparts.
This would also clear the road, if someday one wants to be able to display the size in `bits` instead of `bytes`: the `B` would become a lowercase letter (such as 'Mib', 'Kib', 'b', etc.).
Updated by Robin Hahling almost 5 years ago
I think this all makes sense. If I remember correctly, the rationale behind not displaying the full unit name was some concerns about the width of a line. But 2 more characters at most is not that bad. However, I'm not sure whether this would be a real benefit for the users or not. I need to think about it a little.