diff options
author | Brad King <brad.king@kitware.com> | 2020-04-14 13:42:50 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-04-14 13:45:55 (GMT) |
commit | 734238d64f292af9d3f68742c18b0ac96b78ac06 (patch) | |
tree | 8137fd572a13853a2c913c33048bbda58aeb6bce /Help | |
parent | b54d80b29344d3544f4d51a4ae466fb3d8a5e0f0 (diff) | |
parent | da99eca1e7956e42e88df1b52c322f9c571acddd (diff) | |
download | CMake-734238d64f292af9d3f68742c18b0ac96b78ac06.zip CMake-734238d64f292af9d3f68742c18b0ac96b78ac06.tar.gz CMake-734238d64f292af9d3f68742c18b0ac96b78ac06.tar.bz2 |
Merge topic 'sort_list_natural_20563'
da99eca1e7 list: add NATURAL sorting on SORT sub-command
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4602
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/list.rst | 7 | ||||
-rw-r--r-- | Help/release/dev/list_natural_sort.rst | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Help/command/list.rst b/Help/command/list.rst index 50bf417..4d339a0 100644 --- a/Help/command/list.rst +++ b/Help/command/list.rst @@ -308,6 +308,13 @@ The ``<compare>`` option should be one of: * ``STRING``: Sorts a list of strings alphabetically. This is the default behavior if the ``COMPARE`` option is not given. * ``FILE_BASENAME``: Sorts a list of pathnames of files by their basenames. +* ``NATURAL``: Sorts a list of strings using natural order + (see ``strverscmp(3)`` manual), i.e. such that contiguous digits + are compared as whole numbers. + For example: the following list `10.0 1.1 2.1 8.0 2.0 3.1` + will be sorted as `1.1 2.0 2.1 3.1 8.0 10.0` if the ``NATURAL`` + comparison is selected where it will be sorted as + `1.1 10.0 2.0 2.1 3.1 8.0` with the ``STRING`` comparison. Use the ``CASE`` keyword to select a case sensitive or case insensitive sort mode. The ``<case>`` option should be one of: diff --git a/Help/release/dev/list_natural_sort.rst b/Help/release/dev/list_natural_sort.rst new file mode 100644 index 0000000..ff74e5a --- /dev/null +++ b/Help/release/dev/list_natural_sort.rst @@ -0,0 +1,5 @@ +list_natural_sort +----------------- + +* The :command:`list` operation ``SORT`` gained the ``NATURAL`` sort + option to sort using natural order (see ``strverscmp(3)`` manual). |