pw_build: Shell escape printed commands
This makes it possible to copy and paste python_runner.py commands.
Change-Id: I4432a6bdf154920d2ef5ae50fd4b198e8921344a
diff --git a/pw_build/py/python_runner.py b/pw_build/py/python_runner.py
index 88039bc..d1aa41b 100644
--- a/pw_build/py/python_runner.py
+++ b/pw_build/py/python_runner.py
@@ -16,6 +16,7 @@
import argparse
import os
import pathlib
+import shlex
import subprocess
import sys
@@ -113,7 +114,7 @@
return 1
command = [sys.executable] + resolved_command
- print('RUN', ' '.join(command), flush=True)
+ print('RUN', ' '.join(shlex.quote(arg) for arg in command), flush=True)
try:
status = subprocess.call(command)