From 0bdd0c4ebaf9d1b891aab5395b3e0e0f7d3800a6 Mon Sep 17 00:00:00 2001
From: "Huang, Zhaoquan"
Date: Fri, 20 May 2022 14:00:16 +0800
Subject: [PATCH] Describe `output` parameter in run_in_windows_bash
---
reference/tools.rst | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/reference/tools.rst b/reference/tools.rst
index bf9a8c7c6278..41a780847abc 100644
--- a/reference/tools.rst
+++ b/reference/tools.rst
@@ -897,7 +897,7 @@ tools.run_in_windows_bash()
.. code-block:: python
- def run_in_windows_bash(conanfile, bashcmd, cwd=None, subsystem=None, msys_mingw=True, env=None, with_login=True)
+ def run_in_windows_bash(conanfile, bashcmd, cwd=None, subsystem=None, msys_mingw=True, env=None, with_login=True, output=True)
Runs a UNIX command inside a bash shell. It requires to have "bash" in the path.
Useful to build libraries using ``configure`` and ``make`` in Windows. Check :ref:`Windows subsytems ` section.
@@ -924,6 +924,15 @@ Parameters:
will have more priority than others.
- **with_login** (Optional, Defaulted to ``True``): Pass the ``--login`` flag to :command:`bash` command. This might come handy when you
don't want to create a fresh user session for running the command.
+ - **output** (Optional, Defaulted to ``True``): When True it will write in stdout. You can pass any stream that accepts a ``write``
+ method like a ``six.StringIO()``:
+
+ .. code-block:: python
+
+ from six import StringIO # Python 2 and 3 compatible
+ mybuf = StringIO()
+ tools.run_in_windows_bash(self, "mycommand", output=mybuf)
+ self.output.warn(mybuf.getvalue())
.. _tools_get_cased_path: