From 6ee583e119b432fee03f908547729d5da030397e Mon Sep 17 00:00:00 2001 From: Charles Brunet Date: Thu, 9 Jan 2025 17:00:09 -0500 Subject: allow to compare multiple version with version_compare --- docs/markdown/snippets/multiple_version_compare.md | 8 ++++++++ docs/yaml/elementary/str.yml | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 docs/markdown/snippets/multiple_version_compare.md (limited to 'docs') diff --git a/docs/markdown/snippets/multiple_version_compare.md b/docs/markdown/snippets/multiple_version_compare.md new file mode 100644 index 000000000..5e8c7582f --- /dev/null +++ b/docs/markdown/snippets/multiple_version_compare.md @@ -0,0 +1,8 @@ +## `version_compare` now accept multiple compare strings + +Is it now possible to compare version against multiple values, to check for +a range of version for instance. + +```meson +'1.5'.version_compare('>=1', '<2') +``` diff --git a/docs/yaml/elementary/str.yml b/docs/yaml/elementary/str.yml index 9d059cc09..44aa74240 100644 --- a/docs/yaml/elementary/str.yml +++ b/docs/yaml/elementary/str.yml @@ -306,6 +306,12 @@ methods: It is best to be unambiguous and specify the full revision level to compare. + *Since 1.8.0* multiple versions can be compared: + + ```meson + '3.6'.version_compare('>=3', '<4.0') == true + ``` + posargs: compare_string: type: str -- cgit v1.2.3