cli: allow map values in --params arguments
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 15 Aug 2019 04:00:15 +0000 (00:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Sep 2019 15:58:22 +0000 (11:58 -0400)
commitc54abe7826293ffe352119b30d0c12c9216b4cfc
tree2c098f67e7e8590930edb04b090f90d372e4fe73
parent6de20e2771dedaa2831c3d95edaba91e10fb6498
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.026612 seconds and 4 git commands to generate.