summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorJohnny Jazeix <jazeix@gmail.com>2020-04-13 16:26:28 (GMT)
committerJohnny Jazeix <jazeix@gmail.com>2020-04-13 16:26:28 (GMT)
commitda99eca1e7956e42e88df1b52c322f9c571acddd (patch)
treea56a4154cfe09f318cbd3b235c22b0378f230d5d /Help
parentfab932c3cba9423443c7ab25fda3999e4fc4b347 (diff)
downloadCMake-da99eca1e7956e42e88df1b52c322f9c571acddd.zip
CMake-da99eca1e7956e42e88df1b52c322f9c571acddd.tar.gz
CMake-da99eca1e7956e42e88df1b52c322f9c571acddd.tar.bz2
list: add NATURAL sorting on SORT sub-command
Fixes: #20563
Diffstat (limited to 'Help')
-rw-r--r--Help/command/list.rst7
-rw-r--r--Help/release/dev/list_natural_sort.rst5
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).