cli: put space after comma between array elements
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 25 Apr 2019 00:55:47 +0000 (20:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:39 +0000 (18:19 -0400)
This is more readable when looking at the output of `--run-args`.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I75a4622fb2f2c864f4af1599c18044bb696c3307

cli/babeltrace-cfg-cli-args.c
tests/cli/test_convert_args.in

index 06385a35d1e908edfd3b0c9bd0870894ecdf6210..dfce55bdec8a41698ac5b252df32f67d35e3e6ad 100644 (file)
@@ -3223,11 +3223,17 @@ int bt_value_to_cli_param_value_append(const bt_value *value, GString *buf)
                g_string_append_c(buf, '[');
                uint64_t sz = bt_value_array_get_size(value);
                for (uint64_t i = 0; i < sz; i++) {
+                       const bt_value *item;
+                       int ret;
+
                        if (i > 0) {
-                               g_string_append_c(buf, ',');
+                               g_string_append(buf, ", ");
                        }
-                       const bt_value *item = bt_value_array_borrow_element_by_index_const(value, i);
-                       int ret = bt_value_to_cli_param_value_append(item, buf);
+
+                       item = bt_value_array_borrow_element_by_index_const(
+                               value, i);
+                       ret = bt_value_to_cli_param_value_append(item, buf);
+
                        if (ret) {
                                goto end;
                        }
index 1f47111303d8535ad366035566855b3798a34092..a8404b3f5d570310d0bb63bb11a5993ab8f7e843 100644 (file)
@@ -74,7 +74,7 @@ comment() {
 plan_tests 76
 
 test_bt_convert_run_args 'path leftover' "$path_to_trace" "--component source.ctf.fs --name source-ctf-fs --params 'paths=[\"$path_to_trace\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect source-ctf-fs:muxer --connect muxer:pretty"
-test_bt_convert_run_args 'path leftovers' "$path_to_trace ${path_to_trace}2 ${path_to_trace}3" "--component source.ctf.fs --name source-ctf-fs --params 'paths=[\"$path_to_trace\",\"${path_to_trace}2\",\"${path_to_trace}3\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect source-ctf-fs:muxer --connect muxer:pretty"
+test_bt_convert_run_args 'path leftovers' "$path_to_trace ${path_to_trace}2 ${path_to_trace}3" "--component source.ctf.fs --name source-ctf-fs --params 'paths=[\"$path_to_trace\", \"${path_to_trace}2\", \"${path_to_trace}3\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path leftover + named user source with --params' "$path_to_trace --component ZZ:source.another.source --params salut=yes" "--component ZZ:source.another.source --params salut=yes --component source.ctf.fs --name source-ctf-fs --params 'paths=[\"$path_to_trace\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect ZZ:muxer --connect source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path leftover + named user source with --name --params' "$path_to_trace --component source.another.source --name HELLO --params salut=yes" "--component source.another.source --name HELLO --params salut=yes --component source.ctf.fs --name source-ctf-fs --params 'paths=[\"$path_to_trace\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect HELLO:muxer --connect source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path leftover + user source with --path --params' "$path_to_trace --component source.another.source --path some-path --params salut=yes" "--component source.another.source --params 'path=\"some-path\"' --params salut=yes --name source.another.source --component source.ctf.fs --name source-ctf-fs --params 'paths=[\"$path_to_trace\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect 'source\\.another\\.source:muxer' --connect source-ctf-fs:muxer --connect muxer:pretty"
This page took 0.028119 seconds and 4 git commands to generate.