summaryrefslogtreecommitdiff
path: root/doc/coreutils.texi
diff options
context:
space:
mode:
authorMichael Speer <knomenet@gmail.com>2009-04-27 14:51:29 +0100
committerPádraig Brady <P@draigBrady.com>2009-05-26 14:49:17 +0100
commit159faba1376ffd5a46fe4bbc780d85dd3e502cea (patch)
tree26c0be6ee86af0609569bdc7af0999e03b1e2b3e /doc/coreutils.texi
parentc45c51fe97193898f3909dcf5e4c0e117ab239a2 (diff)
downloadcoreutils-159faba1376ffd5a46fe4bbc780d85dd3e502cea.tar.xz
sort: new --human-numeric-sort option to sort KiB MB etc.
* NEWS: Document the new option * doc/coreutils.texi (sort invocation): ditto * src/sort.c (main): handle the new --human-numeric-sort option (-h). (human_numcompare): A new function to compare SI and IEC suffixes before falling back to the standard --numeric comparison. (find_unit_order): A new helper function to find the order of magnitude of a number string as determined by its suffix. (check_mixed_SI_IEC): A new helper function to exit with error if both SI and IEC suffixes are presented. * tests/misc/sort: Add 8 tests to test the new functionality. * THANKS: Update
Diffstat (limited to 'doc/coreutils.texi')
-rw-r--r--doc/coreutils.texi15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 97ea830e1..834bd462c 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -3785,6 +3785,21 @@ Use this option only if there is no alternative; it is much slower than
@option{--numeric-sort} (@option{-n}) and it can lose information when
converting to floating point.
+@item -h
+@itemx --human-numeric-sort
+@itemx --sort=human-numeric
+@opindex -h
+@opindex --human-numeric-sort
+@opindex --sort
+@cindex human numeric sort
+@vindex LC_NUMERIC
+Sort numerically, as per the @option{--numeric-sort} option below, and in
+addition handle IEC or SI suffixes like MiB, MB etc (@ref{Block size}).
+Note a mixture of IEC and SI suffixes is not supported and will
+be flagged as an error. Also the numbers must be abbreviated uniformly.
+I.E. values with different precisions like 6000K and 5M will be sorted
+incorrectly.
+
@item -i
@itemx --ignore-nonprinting
@opindex -i