summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/snippets/find_program_version_argument.md12
-rw-r--r--docs/yaml/functions/find_program.yaml9
2 files changed, 20 insertions, 1 deletions
diff --git a/docs/markdown/snippets/find_program_version_argument.md b/docs/markdown/snippets/find_program_version_argument.md
new file mode 100644
index 000000000..99fe62109
--- /dev/null
+++ b/docs/markdown/snippets/find_program_version_argument.md
@@ -0,0 +1,12 @@
+## New version_argument kwarg for find_program
+
+When finding an external program with `find_program`, the `version_argument`
+can be used to override the default `--version` argument when trying to parse
+the version of the program.
+
+For example, if the following is used:
+```meson
+foo = find_program('foo', version_argument: '-version')
+```
+
+meson will internally run `foo -version` when trying to find the version of `foo`.
diff --git a/docs/yaml/functions/find_program.yaml b/docs/yaml/functions/find_program.yaml
index 4a17e8637..1899941ab 100644
--- a/docs/yaml/functions/find_program.yaml
+++ b/docs/yaml/functions/find_program.yaml
@@ -102,13 +102,20 @@ kwargs:
since: 0.52.0
description: |
Specifies the required version, see
- [[dependency]] for argument format. The version of the program
+ [[dependency]] for argument format. By default, the version of the program
is determined by running `program_name --version` command. If stdout is empty
it fallbacks to stderr. If the output contains more text than simply a version
number, only the first occurrence of numbers separated by dots is kept.
If the output is more complicated than that, the version checking will have to
be done manually using [[run_command]].
+ version_argument:
+ type: str
+ since: 1.5.0
+ description: |
+ Specifies the argument to pass when trying to find the version of the program.
+ If this is unspecified, `program_name --version` will be used.
+
dirs:
type: list[str]
since: 0.53.0