diff options
Diffstat (limited to 'docs/markdown/External-commands.md')
-rw-r--r-- | docs/markdown/External-commands.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/markdown/External-commands.md b/docs/markdown/External-commands.md index 9336ec3..4c8c8e4 100644 --- a/docs/markdown/External-commands.md +++ b/docs/markdown/External-commands.md @@ -16,6 +16,14 @@ output = r.stdout().strip() errortxt = r.stderr().strip() ``` +Additionally, since 0.50.0, you can pass the command [`environment`](Reference-manual.html#environment-object) object: + +```meson +env = environment() +env.set('FOO', 'bar') +run_command('command', 'arg1', 'arg2', env: env) +``` + The `run_command` function returns an object that can be queried for return value and text written to stdout and stderr. The `strip` method call is used to strip trailing and leading whitespace from |