This removes the redundancy to both print and run the command line.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I9100aa02c221e3699de726668a4de1d6b65ec2d9
gen_mctf_trace() {
local -r input_file="$1"
local -r base_dir="$2"
-
- echo "Running: \`${BT_TESTS_PYTHON_BIN} ${BT_TESTS_SRCDIR}/utils/python/mctf.py --base-dir ${base_dir} ${input_file}\`" >&2
- run_python "${BT_TESTS_PYTHON_BIN}" "${BT_TESTS_SRCDIR}/utils/python/mctf.py" \
- --base-dir "${base_dir}" "${input_file}"
+ local -r cmd=(
+ "$BT_TESTS_PYTHON_BIN" "$BT_TESTS_SRCDIR/utils/python/mctf.py"
+ --base-dir "$base_dir"
+ "$input_file"
+ )
+
+ echo "Running: \`${cmd[*]}\`" >&2
+ run_python "${cmd[@]}"
}