aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-06-20 10:33:09 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-06-20 13:27:23 +0000
commit86684ad798321464d1593d97d5c25127ef26ca94 (patch)
treefa0b3d4b981c015e36d83ba5960cdea2d86797bd /docs
parent59696234daf28760c8d399b14a8ef196ae84f025 (diff)
downloadmeson-86684ad798321464d1593d97d5c25127ef26ca94.zip
meson-86684ad798321464d1593d97d5c25127ef26ca94.tar.gz
meson-86684ad798321464d1593d97d5c25127ef26ca94.tar.bz2
Document environment() append/prepend/set with multiple values [skip ci]
Fixes https://github.com/mesonbuild/meson/issues/3761
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Reference-manual.md27
1 files changed, 15 insertions, 12 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index bab20e1..87fb581 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -1991,20 +1991,23 @@ detailed information about how environment variables should be set
during tests. It should be passed as the `env` keyword argument to
tests. It has the following methods.
-- `append(varname, value)` appends the given value to the old value of
- the environment variable, e.g. `env.append('FOO', 'BAR', separator
- : ';')` produces `BOB;BAR` if `FOO` had the value `BOB` and plain
- `BAR` if the value was not defined. If the separator is not
- specified explicitly, the default path separator for the host
- operating system will be used, i.e. ';' for Windows and ':' for
- UNIX/POSIX systems.
-
-- `prepend(varname, value)` is the same as `append` except that it
+- `append(varname, value1, value2, ...)` appends the given values to the old
+ value of the environment variable, e.g. `env.append('FOO', 'BAR', 'BAZ',
+ separator : ';')` produces `BOB;BAR;BAZ` if `FOO` had the value `BOB` and
+ plain `BAR;BAZ` if the value was not defined. If the separator is not
+ specified explicitly, the default path separator for the host operating
+ system will be used, i.e. ';' for Windows and ':' for UNIX/POSIX systems.
+
+- `prepend(varname, value1, value2, ...)` is the same as `append` except that it
writes to the beginning of the variable
-- `set(varname, value)` sets environment variable in the first
- argument to the value in the second argument, e.g.
- `env.set('FOO', 'BAR')` sets envvar `FOO` to value `BAR`
+- `set(varname, value1, value2)` sets the environment variable specified in the
+ first argument to the values in the second argument joined by the separator,
+ e.g. `env.set('FOO', 'BAR'),` sets envvar `FOO` to value `BAR`. See
+ `append()` above for how separators work.
+
+**Note:** All these methods overwrite the previously-defined value(s) if called
+twice with the same `varname`.
### `external library` object