Skip to content

Commit d14478f

Browse files
authored
sim_if/nvc.py: quote words with spaces in printed command (#940)
This allows the command to be directly copied and pasted without having to quote e.g. the JSON in the `-g` argument.
1 parent 58dcffd commit d14478f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/news.d/940.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[NVC] Multi-word command line arguments are now quoted in the log.

vunit/sim_if/nvc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def simulate(self, output_path, test_suite_name, config, elaborate_only):
275275
if wave_file:
276276
cmd += [f"--wave={wave_file}"]
277277

278-
print(" ".join(cmd))
278+
print(" ".join([f"'{word}'" if " " in word else word for word in cmd]))
279279

280280
status = True
281281

0 commit comments

Comments
 (0)