cli: allow map values in --params arguments
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 15 Aug 2019 04:00:15 +0000 (00:00 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 17 Aug 2019 00:12:13 +0000 (20:12 -0400)
commit3971c70163bbc4056e285932580e0e731b40a151
tree0dbbf09d97abfb5e0f759b0e19a9dc321f89cc7a
parent7b8c5132ba2d578e6df2fbe1375d3ce6d23ad051
cli: allow map values in --params arguments

This patch makes it possible to use map values in --params arguments.
For example:

    --params 'a={hi="mlady",mapping={tete="epaule",genou="orteil"}}'

The chosen syntax uses curly braces to delimit the map.  It uses an
equal sign between the key an value, to be consistent with the syntax of
the implicit map at the top-level of `--params` values.

Speaking of which: it's not done in this patch, but it should be
possible to make the new function a bit more generic and re-use it for
parsing the top-level dict of `--params` values.

Change-Id: I1400ff6a2cf6c9132a9c5dd731a462f43225146b
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1936
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/cli/babeltrace2-cfg-cli-args.c
src/cli/babeltrace2-cfg-cli-params-arg.c
tests/cli/params/test_params
This page took 0.026329 seconds and 4 git commands to generate.