From d14478ff4164b8324e75a4ac351d84fbc57cc758 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Thu, 13 Jul 2023 09:39:39 +0100 Subject: [PATCH] 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. --- docs/news.d/940.misc.rst | 1 + vunit/sim_if/nvc.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 docs/news.d/940.misc.rst diff --git a/docs/news.d/940.misc.rst b/docs/news.d/940.misc.rst new file mode 100644 index 000000000..aed570158 --- /dev/null +++ b/docs/news.d/940.misc.rst @@ -0,0 +1 @@ +[NVC] Multi-word command line arguments are now quoted in the log. diff --git a/vunit/sim_if/nvc.py b/vunit/sim_if/nvc.py index c3391fe05..76edece7b 100644 --- a/vunit/sim_if/nvc.py +++ b/vunit/sim_if/nvc.py @@ -275,7 +275,7 @@ def simulate(self, output_path, test_suite_name, config, elaborate_only): if wave_file: cmd += [f"--wave={wave_file}"] - print(" ".join(cmd)) + print(" ".join([f"'{word}'" if " " in word else word for word in cmd])) status = True