From 6acfe48f32110671a0adf80ad3497a35105b265d Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 23 Feb 2022 16:56:27 -0500 Subject: Allow setting method/separator in environment() and meson.add_devenv() --- docs/markdown/snippets/devenv.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/devenv.md b/docs/markdown/snippets/devenv.md index 505f971..104cfd9 100644 --- a/docs/markdown/snippets/devenv.md +++ b/docs/markdown/snippets/devenv.md @@ -21,3 +21,23 @@ directory, that file is loaded by gdb automatically. With `--dump` option, all envorinment variables that have been modified are printed instead of starting an interactive shell. It can be used by shell scripts that wish to setup their environment themself. + +## New `method` and `separator` kwargs on `environment()` and `meson.add_devenv()` + +It simplifies this common pattern: +```meson +env = environment() +env.prepend('FOO', ['a', 'b'], separator: ',') +meson.add_devenv(env) +``` + +becomes one line: +```meson +meson.add_devenv({'FOO': ['a', 'b']}, method: 'prepend', separator: ',') +``` + +or two lines: +```meson +env = environment({'FOO': ['a', 'b']}, method: 'prepend', separator: ',') +meson.add_devenv(env) +``` -- cgit v1.1